use local container if it doesn't exist in the remote

This commit is contained in:
Kay0u 2021-01-07 20:28:04 +01:00
parent 4a97060018
commit e8de4eeb53
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D

View file

@ -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% \