From 5141b68daf360e9a3c463a719480821e7367705f Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Sun, 4 Sep 2022 14:19:10 +0200 Subject: [PATCH] Fix restore & remove --- scripts/remove | 12 +++++------- scripts/restore | 5 ++--- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/scripts/remove b/scripts/remove index 821bf0d..bf4b37b 100644 --- a/scripts/remove +++ b/scripts/remove @@ -67,14 +67,12 @@ ynh_remove_app_dependencies ynh_script_progression --message="Removing various files..." # If NetData is installed, configure it not to feed InfluxDB any more -netdata_conf="/opt/netdata/etc/netdata/netdata.conf" +netdata_conf="/opt/netdata/etc/netdata/exporting.conf" if [[ -f "$netdata_conf" ]] ; then - sed -i '/^\[backend\]$/,/^\[/ { - s/enabled = yes/# enabled = no/ - s/type = opentsdb/# type = graphite/ - s/destination = localhost:4242/# destination = localhost/ - s/update every = 60/# update every = 10/ - }' $netdata_conf + sed -i '/^\[exporting:global\]$/,/^\[/ { + s/enabled = yes/enabled = no/ + s/update every = 60/# update every = 10/ + }' $netdata_conf fi ynh_secure_remove --file="/etc/grafana/grafana.ini" diff --git a/scripts/restore b/scripts/restore index 3294352..fdc5091 100644 --- a/scripts/restore +++ b/scripts/restore @@ -29,7 +29,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name @@ -38,8 +37,8 @@ db_user=$db_name #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +test ! -d "/etc/influxdb" \ + || ynh_die --message="InfluxDB / Grafana are already installed" #================================================= # STANDARD RESTORATION STEPS