diff --git a/scripts/remove b/scripts/remove index 15c499f..3b46295 100644 --- a/scripts/remove +++ b/scripts/remove @@ -50,6 +50,7 @@ ynh_script_progression --message="Removing dependencies..." --weight=26 # Remove metapackage and its dependencies ynh_remove_app_dependencies +ynh_exec_warn_less dpkg -r grafana #================================================= # REMOVE NGINX CONFIGURATION diff --git a/scripts/restore b/scripts/restore index aeff4d4..da7ad4a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -58,7 +58,27 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=24 # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies -ynh_install_extra_app_dependencies --repo="deb https://packages.grafana.com/oss/deb stable main" --package="grafana" --key="https://packages.grafana.com/gpg.key" + +#================================================= +# DOWNLOAD AND REINSTALL GRAFANA DEB PACKAGE +#================================================= +ynh_script_progression --message="Downloading Grafana..." --weight=11 + +temp_folder="$(mktemp -d)" + +grafana_deb_dst="$temp_folder/grafana_deb.deb" + +if [ -n "$(uname -m | grep armv6)" ] +then + grafana_deb_url="$url_armv6" +else + grafana_deb_url="$url" +fi + +ynh_exec_quiet "wget -q -O $grafana_deb_dst $grafana_deb_url" + +ynh_script_progression --message="Installing Grafana..." --weight=11 + DEBIAN_FRONTEND=noninteractive ynh_exec_warn_less dpkg --force-confold -i $grafana_deb_dst #================================================= # RESTORE THE MYSQL DATABASE diff --git a/scripts/upgrade b/scripts/upgrade index f137f6d..978fc23 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -85,7 +85,27 @@ if [ -f "/etc/apt/sources.list.d/grafana_stable.list" ] ; then fi ynh_install_app_dependencies $pkg_dependencies -ynh_install_extra_app_dependencies --repo="deb https://packages.grafana.com/oss/deb stable main" --package="grafana (=$GRAFANA_VERSION)" --key="https://packages.grafana.com/gpg.key" + +#================================================= +# DOWNLOAD AND INSTALL UPDATED GRAFANA DEB PACKAGE +#================================================= +ynh_script_progression --message="Downloading Grafana..." --weight=11 + +temp_folder="$(mktemp -d)" + +grafana_deb_dst="$temp_folder/grafana_deb.deb" + +if [ -n "$(uname -m | grep armv6)" ] +then + grafana_deb_url="$url_armv6" +else + grafana_deb_url="$url" +fi + +ynh_exec_quiet "wget -q -O $grafana_deb_dst $grafana_deb_url" + +ynh_script_progression --message="Installing Grafana..." --weight=11 + DEBIAN_FRONTEND=noninteractive ynh_exec_warn_less dpkg --force-confold -i $grafana_deb_dst #================================================= # SPECIFIC UPGRADE