mirror of
https://github.com/YunoHost-Apps/garage_ynh.git
synced 2024-09-03 18:36:32 +02:00
68 lines
2 KiB
Bash
Executable file
68 lines
2 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# REMOVE NODE CONFIGURATION
|
|
#=================================================
|
|
|
|
$garage layout remove "$secret_node_id"
|
|
|
|
garage_layout_apply
|
|
if [ $? -ne 0 ]
|
|
then
|
|
ynh_print_warn --message="Unable to remove the node. Maybe the number of node staying alive is not enough"
|
|
fi
|
|
|
|
#=================================================
|
|
# STANDARD REMOVE
|
|
#=================================================
|
|
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
|
#=================================================
|
|
|
|
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
|
|
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
|
then
|
|
ynh_script_progression --message="Removing $app service integration..."
|
|
yunohost service remove $app
|
|
fi
|
|
|
|
# Remove the dedicated systemd config
|
|
ynh_remove_systemd_config
|
|
|
|
# Remove the app-specific logrotate config
|
|
ynh_remove_logrotate
|
|
|
|
if system_is_inside_container
|
|
then
|
|
ynh_script_progression --message="Umount virtual disk..."
|
|
|
|
# Remove the app directory securely
|
|
$install_dir/umount_disk.sh
|
|
fi
|
|
|
|
# Remove the dedicated NGINX config
|
|
ynh_remove_nginx_config
|
|
|
|
#add wildcard subdomain
|
|
ynh_replace_string --replace_string="server_name $domain" --match_string="server_name $domain *.$domain" --target_file="/etc/nginx/conf.d/$domain.conf"
|
|
ynh_store_file_checksum --file="/etc/nginx/conf.d/$domain.conf"
|
|
|
|
# Remove the log files
|
|
ynh_secure_remove --file="/var/log/$app"
|
|
|
|
ynh_secure_remove --file="/usr/share/yunohost/hooks/conf_regen/98-nginx_$app"
|
|
yunohost tools regen-conf nginx
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|