From e8de4eeb53b797e03ff1fd588f3878340b81fcd3 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Thu, 7 Jan 2021 20:28:04 +0100 Subject: [PATCH] use local container if it doesn't exist in the remote --- lib/lxc.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/lxc.sh b/lib/lxc.sh index 3f3283c..b2f5421 100644 --- a/lib/lxc.sh +++ b/lib/lxc.sh @@ -5,7 +5,12 @@ #================================================= LXC_CREATE () { - lxc launch yunohost:$LXC_BASE $LXC_NAME \ + local remote="" + if lxc image list yunohost: | grep -qw $LXC_BASE + then + remote="yunohost:" + fi + lxc launch ${remote}$LXC_BASE $LXC_NAME \ -c security.nesting=true \ -c security.privileged=true \ -c limits.memory=80% \