remove 1006 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. # Exit on command errors and treat unset variables as an error
  3. set -u
  4. # Loads the generic functions usually used in the script
  5. source .fonctions
  6. # Source app helpers
  7. source /usr/share/yunohost/helpers
  8. # Get multi-instances specific variables
  9. app=$YNH_APP_INSTANCE_NAME
  10. # Retrieve app settings
  11. domain=$(ynh_app_setting_get "$app" domain)
  12. # with_mysql=$(ynh_app_setting_get "$app" with_mysql)
  13. # Drop MySQL database and user as needed
  14. #if [[ $with_mysql -eq 1 ]]; then
  15. dbname=$app
  16. dbuser=$app
  17. dbpass=$(ynh_app_setting_get "$app" mysqlpwd)
  18. ynh_mysql_drop_db $dbname || true
  19. ynh_mysql_drop_user $dbuser || true
  20. #fi
  21. # Delete app directory and configurations
  22. SECURE_REMOVE '/var/www/$app' # Delete directory application
  23. sudo rm -f "/etc/php5/fpm/pool.d/${app}.conf"
  24. sudo rm -f "/etc/php5/fpm/conf.d/20-${app}.ini"
  25. [[ -n $domain ]] && sudo rm -f "/etc/nginx/conf.d/${domain}.d/${app}.conf"
  26. # Reload services
  27. sudo systemctl reload php5-fpm
  28. sudo systemctl reload nginx
  29. sudo yunohost app ssowatconf