1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/couchpotato_ynh.git synced 2024-09-03 18:16:22 +02:00
couchpotato_ynh/scripts/remove
scith d6f696ead0 Major upgrade
- YunoHost 2.4
- Remove method, port, host and fork (remote installs should be done
with direct_ynh) for simplicity
- YunoHost multimedia folder structure
- Integrates with transmission (RPC or watchdir, if available)
- Systemd instead of init
- Backup/restore
- Automatic port finding

Because these are major changes, I was not able to manage upgrade from
previous versions. You must remove the app and reinstall.
2016-12-29 18:34:33 +01:00

41 lines
866 B
Bash

#!/bin/bash
#set -eu
app=$YNH_APP_INSTANCE_NAME
# Source app helpers
. /usr/share/yunohost/helpers
# Common variable declaration
app_install_dir="/opt/yunohost/$app"
app_data_dir="/home/yunohost.app/$app"
app_logs_dir="/var/log/$app"
# Retrieve arguments
domain=$(ynh_app_setting_get "$app" domain)
# Remove files
# Kill app and remove from boot
sudo service $app stop
# Delete app user
sudo deluser $app
# Remove sources
sudo rm -rf $app_install_dir
sudo rm -rf $app_data_dir
sudo rm -rf $app_logs_dir
# Remove data
sudo rm -rf $app_data_dir
# Remove service
sudo systemctl disable $app.service
sudo rm -f /etc/systemd/system/$app.service
sudo systemctl daemon-reload
sudo yunohost service remove $app
# Remove nginx configuration file
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
# Restart services
sudo service nginx reload