diff --git a/scripts/_common.sh b/scripts/_common.sh index d387b1b..34d15ec 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,14 +5,14 @@ app=$YNH_APP_INSTANCE_NAME ## Adapt md5sum while you update app sha256sum="3fb8b4a4f7aeeeafccc6dc5b232f82d5761be80fe8e82008bc768f805fe5a744" -get_app_version_from_json() { +ynh_app_version() { manifest_path="../manifest.json" if [ ! -e "$manifest_path" ]; then manifest_path="../settings/manifest.json" # Into the restore script, the manifest is not at the same place fi echo $(grep '\"version\": ' "$manifest_path" | cut -d '"' -f 4) # Retrieve the version number in the manifest file. } -APP_VERSION=$(get_app_version_from_json) +APP_VERSION=$(ynh_app_version) install_dependances() { ynh_install_app_dependencies rrdtool perl libwww-perl libmailtools-perl libmime-lite-perl librrds-perl libdbi-perl libxml-simple-perl libhttp-server-simple-perl libconfig-general-perl pflogsumm diff --git a/scripts/upgrade b/scripts/upgrade index af90ff9..b73ff7f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,6 +18,9 @@ dbuser=$app dbname=$app dbpass=$(ynh_app_setting_get "$app" mysqlpwd) +# Stop services +systemctl stop monitorix.service + # Download package and install it get_install_source @@ -28,4 +31,4 @@ config_nginx config_monitorix # Reload services -systemctl restart monitorix.service +systemctl start monitorix.service