2014-10-20 16:55:53 +00:00
|
|
|
#!/bin/bash
|
2016-04-26 13:30:49 +00:00
|
|
|
|
|
|
|
# The last argument is the app instance name
|
|
|
|
app=${!#}
|
2014-10-20 16:55:53 +00:00
|
|
|
|
|
|
|
# Retrieve arguments
|
|
|
|
domain=$(sudo yunohost app setting $app domain)
|
|
|
|
path=$(sudo yunohost app setting $app path)
|
|
|
|
admin=$(sudo yunohost app setting $app admin)
|
|
|
|
is_public=$(sudo yunohost app setting $app is_public)
|
|
|
|
|
|
|
|
# Remove sources
|
|
|
|
sudo rm -rf /var/www/$app
|
|
|
|
|
|
|
|
# Remove configuration files
|
|
|
|
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
|
|
|
|
|
2015-10-27 15:03:21 +00:00
|
|
|
# If a database is used, remove it
|
|
|
|
# root_pwd=$(sudo cat /etc/yunohost/mysql)
|
|
|
|
# mysql -u root -p$root_pwd -e "DROP DATABASE $app ; DROP USER $app@localhost ;"
|
|
|
|
|
2015-10-10 19:28:09 +00:00
|
|
|
# If a dedicated php-fpm process is used :
|
|
|
|
#
|
|
|
|
#sudo rm -f /etc/php5/fpm/pool.d/$app.conf
|
|
|
|
#sudo service php5-fpm reload
|
|
|
|
|
2014-10-20 16:55:53 +00:00
|
|
|
# Restart services
|
|
|
|
sudo service nginx reload
|