mirror of
https://github.com/YunoHost-Apps/haste_ynh.git
synced 2024-09-03 20:36:28 +02:00
37 lines
841 B
Bash
Executable file
37 lines
841 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# See comments in install script
|
|
app=${YNH_APP_INSTANCE_NAME:-haste}
|
|
|
|
# Source YunoHost helpers
|
|
source /usr/share/yunohost/helpers
|
|
|
|
# Retrieve app settings
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
|
|
|
# Stop haste
|
|
sudo systemctl stop "$app".service
|
|
|
|
# Remove sources
|
|
sudo rm -rf "/opt/"${app}
|
|
|
|
# Remove post-receive hook
|
|
repo_path="/home/gogs/repositories/"$gogsrepo".git"
|
|
sudo rm -f $repo_path"/hooks/post-receive"
|
|
|
|
# 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
|