diff --git a/scripts/_common.sh b/scripts/_common.sh index 6ca04e1..126fb46 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -18,5 +18,3 @@ pkg_dependencies="perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runt #================================================= # FUTURE OFFICIAL HELPERS #================================================= - - diff --git a/scripts/install b/scripts/install index a466a5f..842b96d 100644 --- a/scripts/install +++ b/scripts/install @@ -71,9 +71,9 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -# ynh_script_progression --message="Setting up source files..." --weight=12 +#ynh_script_progression --message="Setting up source files..." --weight=12 -# ynh_install_extra_app_dependencies --repo="deb http://download.webmin.com/download/repository sarge contrib" --package="webmin" --key="http://www.webmin.com/jcameron-key.asc" +#ynh_install_extra_app_dependencies --repo="deb http://download.webmin.com/download/repository sarge contrib" --package="webmin" --key="http://www.webmin.com/jcameron-key.asc" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -113,8 +113,8 @@ popd || ynh_die # MODIFY A CONFIG FILE #================================================= -ynh_replace_string --match_string="port=10000" --replace_string="port=$port" --target_file="/etc/webmin/miniserv.conf" -ynh_replace_string --match_string="listen=10000" --replace_string="listen=$port" --target_file="/etc/webmin/miniserv.conf" +ynh_replace_string --match_string="port=10000" --replace_string="port=$port" --target_file="/etc/webmin/miniserv.conf" +ynh_replace_string --match_string="listen=10000" --replace_string="listen=$port" --target_file="/etc/webmin/miniserv.conf" #================================================= # STORE THE CONFIG FILE CHECKSUM diff --git a/scripts/upgrade b/scripts/upgrade index 472a7b5..517fba9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -28,11 +28,18 @@ port=$(ynh_app_setting_get --app=$app --key=port) upgrade_type=$(ynh_check_app_version_changed) #================================================= -# CHECK THE PATH +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 -# Normalize the URL path syntax -path_url=$(ynh_normalize_url_path $path_url) +# 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 #================================================= # NGINX CONFIGURATION