diff --git a/scripts/install b/scripts/install index 5640bde..f2fcded 100755 --- a/scripts/install +++ b/scripts/install @@ -193,10 +193,7 @@ then ynh_add_config --template="../conf/default.conf" --destination="/etc/lxc/default.conf" ynh_add_config --template="../conf/lxc-net" --destination="/etc/default/lxc-net" systemctl enable lxc-net --quiet - systemctl start lxc-net --quiet - #iptables -A FORWARD -i $lxc_bridge -o $main_iface -j ACCEPT - #iptables -A FORWARD -i $main_iface -o $lxc_bridge -j ACCEPT - #iptables -t nat -A POSTROUTING -s $plage_ip.0/24 -j MASQUERADE + ynh_systemd_action --service_name=lxc-net --action="restart" --line_match="Started LXC network bridge" --log_path="systemd" fi #================================================= diff --git a/scripts/remove b/scripts/remove index 80619b3..88ea8f8 100755 --- a/scripts/remove +++ b/scripts/remove @@ -53,17 +53,6 @@ ynh_script_progression --message="Removing logrotate configuration..." # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# REMOVE DATA DIR -#================================================= - -# Remove the data directory if --purge option is used -if [ "${YNH_APP_PURGE:-0}" -eq 1 ] -then - ynh_script_progression --message="Removing app data directory..." - ynh_secure_remove --file="$datadir" -fi - #================================================= # REMOVE NGINX CONFIGURATION #================================================= @@ -93,7 +82,7 @@ then lxc_bridge=$(ynh_app_setting_get --app=$app --key=lxc_bridge) - systemctl stop lxc-net --quiet + ynh_systemd_action --service_name=lxc-net --action="stop" systemctl disable lxc-net --quiet ynh_secure_remove --file="/etc/default/lxc-net" ynh_secure_remove --file="/etc/lxc/default.conf" @@ -109,6 +98,17 @@ ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies ynh_remove_app_dependencies +#================================================= +# REMOVE DATA DIR +#================================================= + +# Remove the data directory if --purge option is used +if [ "${YNH_APP_PURGE:-0}" -eq 1 ] +then + ynh_script_progression --message="Removing app data directory..." + ynh_secure_remove --file="$datadir" +fi + #================================================= # SPECIFIC REMOVE #================================================= diff --git a/scripts/restore b/scripts/restore index 7423905..597f3ff 100755 --- a/scripts/restore +++ b/scripts/restore @@ -119,10 +119,7 @@ then ynh_add_config --template="../conf/lxc-net" --destination="/etc/default/lxc-net" ynh_add_config --template="../conf/default.conf" --destination="/etc/lxc/default.conf" systemctl enable lxc-net --quiet - systemctl start lxc-net --quiet - #iptables -A FORWARD -i $lxc_bridge -o $main_iface -j ACCEPT - #iptables -A FORWARD -i $main_iface -o $lxc_bridge -j ACCEPT - #iptables -t nat -A POSTROUTING -s $plage_ip.0/24 -j MASQUERADE + ynh_systemd_action --service_name=lxc-net --action="restart" --line_match="Started LXC network bridge" --log_path="systemd" fi #=================================================