remove 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/bash
  2. #=================================================
  3. # GENERIC START
  4. #=================================================
  5. # IMPORT GENERIC HELPERS
  6. #=================================================
  7. source _common.sh
  8. source /usr/share/yunohost/helpers
  9. #=================================================
  10. # STANDARD REMOVE
  11. #=================================================
  12. # REMOVE SERVICE INTEGRATION IN YUNOHOST
  13. #=================================================
  14. ynh_script_progression --message="Removing system configurations related to $app..." --weight=5
  15. # remove flohmarkt database and database user
  16. ynh_script_progression --message="removing flohmarkt couchdb user and database" --weight=2
  17. # @@ wie komme ich hier an das admin-password, falls ich es brauche?
  18. # * brauche ich es? → ja
  19. # db:
  20. # curl -X DELETE 'http://127.0.0.1:5984/flohmarkt' --user '<admin-user>:<admin-password>'
  21. # user:
  22. # curl -X DELETE "http://127.0.0.1:5984/_users/org.couchdb.user%3Aflohmarkt?rev=`curl -sX GET 'http://127.0.0.1:5984/_users/org.couchdb.user%3Aflohmarkt' --user 'admin:bla42fasel' | jq -r ._rev`" --user '<admin-user>:<admin-password>'
  23. # Stop flohmarkt service
  24. ynh_script_progression --message="Stopping $app..." --weight=2
  25. yunohost service stop $app
  26. # Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
  27. if ynh_exec_warn_less yunohost service status $app >/dev/null
  28. then
  29. ynh_script_progression --message="Removing $app service integration..." --weight=2
  30. yunohost service remove $app
  31. fi
  32. # Remove the app-specific logrotate config
  33. ynh_remove_logrotate
  34. # Remove the dedicated NGINX config
  35. ynh_remove_nginx_config
  36. # Remove the dedicated Fail2Ban config
  37. ynh_remove_fail2ban_config
  38. #=================================================
  39. # END OF SCRIPT
  40. #=================================================
  41. ynh_script_progression --message="Removal of $app completed" --last