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