2017-09-27 23:15:40 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2017-10-19 19:57:17 +02:00
|
|
|
|
2017-09-27 23:15:40 +02:00
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
|
|
final_path=$(ynh_app_setting_get $app final_path)
|
|
|
|
launch_on_boot=$(ynh_app_setting_get $app launch_on_boot)
|
2017-10-19 19:57:17 +02:00
|
|
|
open_webserver_port=$(ynh_app_setting_get $app open_webserver_port)
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GLOBAL VARS
|
|
|
|
#=================================================
|
|
|
|
arch=$(uname -m)
|
|
|
|
|
2017-09-27 23:15:40 +02:00
|
|
|
|
2017-10-16 22:48:13 +02:00
|
|
|
#=================================================
|
|
|
|
# REMOVE SYSTEMD SCRIPT (SERVICE)
|
|
|
|
#=================================================
|
2017-10-19 19:57:17 +02:00
|
|
|
# Stop and diasble Kodi service
|
|
|
|
# Remove kodi.service file
|
2017-10-16 22:48:13 +02:00
|
|
|
ynh_remove_systemd_config
|
|
|
|
|
2017-10-19 19:57:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
ynh_remove_nginx_config
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# CLOSE WEB SERVER PORT
|
|
|
|
#=================================================
|
|
|
|
if [ $open_webserver_port -eq 1 ]
|
|
|
|
then
|
|
|
|
yunohost firewall disallow TCP 8080 2>&1
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-16 22:48:13 +02:00
|
|
|
#=================================================
|
|
|
|
# REMOVE SERVICE FROM ADMIN PANEL
|
|
|
|
#=================================================
|
|
|
|
if yunohost service status | grep -q $app
|
|
|
|
then
|
|
|
|
echo "Remove $app service"
|
|
|
|
yunohost service remove $app
|
|
|
|
fi
|
|
|
|
sudo systemctl daemon-reload
|
|
|
|
|
2017-09-27 23:15:40 +02:00
|
|
|
|
2017-10-19 19:57:17 +02:00
|
|
|
|
2017-09-27 23:15:40 +02:00
|
|
|
#=================================================
|
2017-10-19 19:57:17 +02:00
|
|
|
# X11 SETTINGS
|
2017-09-27 23:15:40 +02:00
|
|
|
#=================================================
|
2017-09-27 23:24:12 +02:00
|
|
|
sudo sed -i 's/allowed_users=anybody/allowed_users=console/' /etc/X11/Xwrapper.config
|
2017-10-19 19:57:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEPENDENCIES AND KODI
|
|
|
|
#=================================================
|
2017-09-28 07:54:48 +02:00
|
|
|
if [[ $arch != arm* ]]; then
|
2017-10-19 19:57:17 +02:00
|
|
|
ynh_package_remove xorg xinit dbus-x11 kodi
|
|
|
|
ynh_secure_remove "/etc/apt/sources.list.d/${app}.list"
|
|
|
|
ynh_package_update
|
|
|
|
else
|
|
|
|
ynh_package_remove xserver-xorg-legacy xorg dbus-x11 kodi
|
2017-09-28 07:54:48 +02:00
|
|
|
fi
|
2017-10-19 19:57:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE SYSTEMD CONFIG
|
|
|
|
#=================================================
|
|
|
|
ynh_remove_systemd_config
|
|
|
|
|
2017-09-27 23:15:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE APP MAIN DIR
|
|
|
|
#=================================================
|
|
|
|
# Remove the app directory securely
|
|
|
|
ynh_secure_remove "$final_path"
|
|
|
|
|
|
|
|
|
2017-10-19 19:57:17 +02:00
|
|
|
|
2017-09-27 23:15:40 +02:00
|
|
|
#=================================================
|
|
|
|
# REMOVE KODI USER
|
|
|
|
#=================================================
|
|
|
|
ynh_system_user_delete "$app"
|
2017-09-30 11:56:47 +02:00
|
|
|
|
|
|
|
|
2017-09-27 23:15:40 +02:00
|
|
|
|