mirror of
https://github.com/YunoHost-Apps/cryptpad_ynh.git
synced 2024-09-03 18:26:14 +02:00
Create remove
This commit is contained in:
parent
031eac7fd1
commit
b105f77e2f
1 changed files with 34 additions and 0 deletions
34
scripts/remove
Normal file
34
scripts/remove
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Source app helpers
|
||||||
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
|
# Exit on command errors and treat unset variables as an error
|
||||||
|
set -u
|
||||||
|
set -eu
|
||||||
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
# Retrieve app settings
|
||||||
|
domain=$(ynh_app_setting_get $app domain)
|
||||||
|
|
||||||
|
sudo systemctl stop $app.service
|
||||||
|
|
||||||
|
# Remove sources
|
||||||
|
sudo rm -rf /var/www/$app
|
||||||
|
|
||||||
|
# Remove nginx configuration file
|
||||||
|
[[ -n $domain ]] && sudo rm -f /etc/nginx/conf.d/${domain}.d/${app}.conf
|
||||||
|
|
||||||
|
# Remove haste user and data
|
||||||
|
sudo userdel -r $app
|
||||||
|
|
||||||
|
# Remove init script
|
||||||
|
sudo systemctl disable $app.service
|
||||||
|
sudo rm -f /etc/systemd/system/$app.service
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
|
||||||
|
# Remove monitor
|
||||||
|
sudo yunohost service remove $app
|
||||||
|
|
||||||
|
# Reload nginx service
|
||||||
|
sudo systemctl reload nginx.service
|
Loading…
Reference in a new issue