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

57 lines
1.9 KiB
Text
Raw Permalink Normal View History

2017-02-18 16:45:43 +01:00
#!/bin/bash
2017-12-03 19:24:03 +01:00
#=================================================
2020-05-17 09:28:22 +02:00
# GENERIC START
2017-12-03 19:24:03 +01:00
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
2020-05-17 09:28:22 +02:00
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE SERVICE INTEGRATION IN YUNOHOST
#=================================================
2017-02-18 16:45:43 +01:00
2022-03-06 19:14:13 +01:00
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
2020-05-17 09:28:22 +02:00
if ynh_exec_warn_less yunohost service status grafana-server >/dev/null
then
2021-08-22 16:17:29 +02:00
ynh_script_progression --message="Removing $app service integration..." --weight=1
2020-05-17 09:28:22 +02:00
yunohost service remove grafana-server
yunohost service remove influxdb
fi
2017-02-18 16:45:43 +01:00
2020-05-17 09:28:22 +02:00
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
2021-08-03 08:02:26 +02:00
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
2020-05-17 09:28:22 +02:00
2021-08-22 16:17:29 +02:00
# Remove the dedicated NGINX config
2020-05-17 09:28:22 +02:00
ynh_remove_nginx_config
#=================================================
# SPECIFIC REMOVE
#=================================================
2022-03-06 19:14:13 +01:00
# REMOVE VARIOUS FILES
#=================================================
ynh_script_progression --message="Removing various files..."
2017-08-03 07:38:57 +02:00
2017-02-18 16:45:43 +01:00
# If NetData is installed, configure it not to feed InfluxDB any more
netdata_conf="/var/www/netdata/etc/netdata/exporting.conf"
2017-02-18 16:45:43 +01:00
if [[ -f "$netdata_conf" ]] ; then
2022-09-04 14:19:10 +02:00
sed -i '/^\[exporting:global\]$/,/^\[/ {
s/enabled = yes/enabled = no/
s/update every = 60/# update every = 10/
}' $netdata_conf
2017-02-18 16:45:43 +01:00
fi
2020-05-17 09:28:22 +02:00
ynh_secure_remove --file="/etc/grafana/grafana.ini"
2017-02-18 16:45:43 +01:00
2020-05-17 09:28:22 +02:00
#=================================================
# END OF SCRIPT
#=================================================
2017-02-18 16:45:43 +01:00
2020-05-17 09:28:22 +02:00
ynh_script_progression --message="Removal of $app completed" --last