diff --git a/manifest.json b/manifest.json index b2989e5..066cf40 100644 --- a/manifest.json +++ b/manifest.json @@ -16,7 +16,7 @@ "requirements": { "yunohost": ">= 3.5" }, - "multi_instance": "false", + "multi_instance": false, "services": [ "nginx" ], diff --git a/scripts/change_url b/scripts/change_url index 1b04ce9..d4b9c1e 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -62,7 +62,7 @@ fi #================================================= ynh_script_progression --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="stop" --line_match="Stopped LSB" #================================================= # MODIFY URL IN NGINX CONF @@ -101,7 +101,7 @@ fi ynh_script_progression --message="Starting a systemd service..." # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --line_match="Started LSB" #================================================= # RELOAD NGINX diff --git a/scripts/install b/scripts/install index 89950cd..59ac3a1 100644 --- a/scripts/install +++ b/scripts/install @@ -101,7 +101,7 @@ ynh_store_file_checksum --file="/etc/webmin/miniserv.conf" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "Webmin Daemon" --log "/var/log/$app/$app.log" +yunohost service add $app --description "Webmin Daemon" #================================================= # START SYSTEMD SERVICE @@ -109,7 +109,7 @@ yunohost service add $app --description "Webmin Daemon" --log "/var/log/$app/$ap ynh_script_progression --message="Starting a systemd service..." # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --line_match="Started LSB" #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index 7ae3598..8ae01cc 100755 --- a/scripts/restore +++ b/scripts/restore @@ -75,14 +75,14 @@ ynh_restore_file --origin_path="/etc/webmin/miniserv.conf" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "Webmin Daemon" --log "/var/log/$app/$app.log" +yunohost service add $app --description "Webmin Daemon" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --line_match="Started LSB" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 32d9e4e..e438e80 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,6 +21,20 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) admin=$(ynh_app_setting_get --app=$app --key=admin) port=$(ynh_app_setting_get --app=$app --key=port) +#================================================= +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." + +# Backup the current version of the app +ynh_backup_before_upgrade +ynh_clean_setup () { + # restore it if the upgrade fails + ynh_restore_upgradebackup +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # CHECK THE PATH #================================================= @@ -35,7 +49,7 @@ path_url=$(ynh_normalize_url_path --path_url=$path_url) #================================================= ynh_script_progression --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="stop" --line_match="Stopped LSB" #================================================= # NGINX CONFIGURATION @@ -53,7 +67,7 @@ ynh_script_progression --message="Upgrading dependencies..." ynh_install_app_dependencies $pkg_dependencies # Install Webmin -ynh_backup_if_checksum_is_different "/etc/webmin/miniserv.conf" +ynh_backup_if_checksum_is_different --file="/etc/webmin/miniserv.conf" ynh_install_extra_app_dependencies --repo="deb https://download.webmin.com/download/repository sarge contrib" --package="webmin" --key="https://download.webmin.com/jcameron-key.asc" #================================================= @@ -76,14 +90,14 @@ ynh_store_file_checksum --file="/etc/webmin/miniserv.conf" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "Webmin Daemon" --log "/var/log/$app/$app.log" +yunohost service add $app --description "Webmin Daemon" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --line_match="Started LSB" #================================================= # SETUP SSOWAT