diff --git a/scripts/_common.sh b/scripts/_common.sh index 700239b..6b08913 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -26,11 +26,6 @@ tweak_yunohost() { } setup_lxd() { - if ! yunohost app list --output-as json --quiet | jq -e '.apps[] | select(.id == "lxd")' >/dev/null; then - ynh_script_progression --message="Installing LXD... (this make take a long time!" - yunohost app install --force https://github.com/YunoHost-Apps/lxd_ynh - fi - ynh_print_info "Configuring lxd..." if [ "$cluster" -eq 1 ]; then diff --git a/scripts/install b/scripts/install index 8fd832c..ca837ac 100644 --- a/scripts/install +++ b/scripts/install @@ -7,6 +7,15 @@ source _common.sh source /usr/share/yunohost/helpers +#================================================= +# INSTALL LXD +#================================================= +ynh_script_progression --message="Installing LXD... (this make take a long time!)" + +if ! yunohost app list --output-as json --quiet | jq -e '.apps[] | select(.id == "lxd")' >/dev/null; then + yunohost app install --force https://github.com/YunoHost-Apps/lxd_ynh +fi + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= diff --git a/scripts/restore b/scripts/restore index 9c080e0..e39b5eb 100644 --- a/scripts/restore +++ b/scripts/restore @@ -14,6 +14,15 @@ source /usr/share/yunohost/helpers ynh_maintenance_mode_ON +#================================================= +# INSTALL LXD +#================================================= +ynh_script_progression --message="Installing LXD... (this make take a long time!)" + +if ! yunohost app list --output-as json --quiet | jq -e '.apps[] | select(.id == "lxd")' >/dev/null; then + yunohost app install --force https://github.com/YunoHost-Apps/lxd_ynh +fi + #================================================= # RESTORE THE APP MAIN DIR #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 1405fec..fdcf795 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -13,6 +13,15 @@ source /usr/share/yunohost/helpers ynh_maintenance_mode_ON +#================================================= +# INSTALL LXD +#================================================= +ynh_script_progression --message="Installing LXD... (this make take a long time!)" + +if ! yunohost app list --output-as json --quiet | jq -e '.apps[] | select(.id == "lxd")' >/dev/null; then + yunohost app install --force https://github.com/YunoHost-Apps/lxd_ynh +fi + #================================================= # STOP SYSTEMD SERVICE #=================================================