1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mumbleserver_ynh.git synced 2024-09-03 19:46:03 +02:00

Rewrite removal

This commit is contained in:
Jean-Baptiste Holcroft 2017-11-29 23:33:33 +01:00
parent 3d4cf111b3
commit 969facc313

View file

@ -9,19 +9,63 @@
source _common.sh
source /usr/share/yunohost/helpers
app=mumbleserver
#=================================================
# LOAD SETTINGS
#=================================================
# Getting port used by mumble to close it
port=$(ynh_app_setting_get $app port)
app=$YNH_APP_INSTANCE_NAME
# Uninstall Mumble and its dependencies
apt autoremove -y mumble-server > /dev/null 2>&1
domain=$(ynh_app_setting_get "$app" domain)
port=$(ynh_app_setting_get "$app" port)
final_path=$(ynh_app_setting_get "$app" final_path)
# Close ports
yunohost firewall disallow Both $port > /dev/null 2>&1
#=================================================
# STANDARD REMOVE
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
# Removing config file
rm -f /etc/mumble-server.ini
# Remove the dedicated systemd config
ynh_remove_systemd_config
# Remove mumble-server service
yunohost service remove mumble-server
#=================================================
# REMOVE SERVICE FROM ADMIN PANEL
#=================================================
if yunohost service status | grep -q "$app"
then
echo "Remove $app service"
yunohost service remove "$app"
fi
#=================================================
# REMOVE DEPENDENCIES
#=================================================
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
#=================================================
# REMOVE APP MAIN DIR
#=================================================
# Remove the app directory securely
ynh_secure_remove "$final_path"
#=================================================
# CLOSE A PORT
#=================================================
if yunohost firewall list | grep -q "\- $port$"
then
echo "Close port $port"
yunohost firewall disallow Both "$port" > /dev/null 2>&1
fi
#=================================================
# SPECIFIC REMOVE
#=================================================
# REMOVE OTHER FILES
#=================================================
ynh_secure_remove "/var/log/mumble-server/$app.log"