1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/grafana_ynh.git synced 2024-09-03 20:36:29 +02:00

Fix restore & remove

This commit is contained in:
Jimmy Monin 2022-09-04 14:19:10 +02:00
parent ee4443671e
commit 5141b68daf
2 changed files with 7 additions and 10 deletions

View file

@ -67,12 +67,10 @@ 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/
sed -i '/^\[exporting:global\]$/,/^\[/ {
s/enabled = yes/enabled = no/
s/update every = 60/# update every = 10/
}' $netdata_conf
fi

View file

@ -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