aboutsummaryrefslogtreecommitdiff
path: root/scripts/remove
diff options
context:
space:
mode:
authormagikcypress <cyp@rouquin.me>2017-04-10 04:55:10 +0200
committermagikcypress <cyp@rouquin.me>2017-04-10 04:55:10 +0200
commit4dfe2759421883575d4a63d2879d58b93bc56f6a (patch)
tree89c16c4295f356fe0c8b7b88f2b8f4f87b62d4db /scripts/remove
parentd04d692b8adee05afaa664067d97727a54f3768c (diff)
downloadmastodon_ynh-4dfe2759421883575d4a63d2879d58b93bc56f6a.tar.gz
mastodon_ynh-4dfe2759421883575d4a63d2879d58b93bc56f6a.tar.bz2
mastodon_ynh-4dfe2759421883575d4a63d2879d58b93bc56f6a.zip
[fix] install + add file remove/restore/upgrade
Diffstat (limited to 'scripts/remove')
-rw-r--r--scripts/remove59
1 files changed, 31 insertions, 28 deletions
diff --git a/scripts/remove b/scripts/remove
index b8f2d6b..bbb9b5b 100644
--- a/scripts/remove
+++ b/scripts/remove
@@ -13,31 +13,10 @@ app=$YNH_APP_INSTANCE_NAME
# Retrieve app settings
domain=$(ynh_app_setting_get "$app" domain)
-# Delete service on Yunohost monitoring
-if sudo yunohost service status | grep -q mastodon-web
-then
- echo "Remove mastodon-web service"
- sudo yunohost service remove mastodon-web
-fi
-
-# Delete service on Yunohost monitoring
-if sudo yunohost service status | grep -q mastodon-sidekiq
-then
- echo "Remove mastodon-sidekiq service"
- sudo yunohost service remove mastodon-sidekiq
-fi
-
-# Delete service on Yunohost monitoring
-if sudo yunohost service status | grep -q mastodon-streaming
-then
- echo "Remove mastodon-streaming service"
- sudo yunohost service remove mastodon-streaming
-fi
-
# Stop mastodon-web
if [ -e "/etc/systemd/system/mastodon-web.service" ]; then
echo "Delete systemd script"
- sudo service mastodon-web.service stop
+ sudo systemctl stop mastodon-web.service
sudo rm "/etc/systemd/system/mastodon-web.service"
sudo systemctl disable mastodon-web.service
fi
@@ -45,7 +24,7 @@ fi
# Stop mastodon-sidekiq
if [ -e "/etc/systemd/system/mastodon-sidekiq.service" ]; then
echo "Delete systemd script"
- sudo service mastodon-sidekiq.service stop
+ sudo systemctl stop mastodon-sidekiq.service
sudo rm "/etc/systemd/system/mastodon-sidekiq.service"
sudo systemctl disable mastodon-sidekiq.service
fi
@@ -53,14 +32,34 @@ fi
# Stop mastodon-sidekiq
if [ -e "/etc/systemd/system/mastodon-streaming.service" ]; then
echo "Delete systemd script"
- sudo service mastodon-sidekiq.streaming stop
+ sudo systemctl stop mastodon-sidekiq.streaming
sudo rm "/etc/systemd/system/mastodon-streaming.service"
sudo systemctl disable mastodon-streaming.service
fi
+# Delete service on Yunohost monitoring
+if sudo yunohost service status | grep -q mastodon-web
+then
+ echo "Remove mastodon-web service"
+ sudo yunohost service remove mastodon-web
+fi
+
+# Delete service on Yunohost monitoring
+if sudo yunohost service status | grep -q mastodon-sidekiq
+then
+ echo "Remove mastodon-sidekiq service"
+ sudo yunohost service remove mastodon-sidekiq
+fi
+
+# Delete service on Yunohost monitoring
+if sudo yunohost service status | grep -q mastodon-streaming
+then
+ echo "Remove mastodon-streaming service"
+ sudo yunohost service remove mastodon-streaming
+fi
+
# delete postgresql database & user
-ynh_psql_drop_db $app
-ynh_psql_drop_user $app
+ynh_psql_drop_db "${app}_production"
# Remove Debian package
#sudo apt-get remove --purge -y imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev file curl git
@@ -75,9 +74,13 @@ ynh_psql_drop_user $app
SECURE_REMOVE '/opt/$app'
[[ -n $domain ]] && sudo rm -f "/etc/nginx/conf.d/${domain}.d/${app}.conf"
-REMOVE_NGINX_CONF # Suppression de la configuration nginx
+# Delete nginx configuration
+REMOVE_NGINX_CONF
-SECURE_REMOVE '/var/log/$app/' # Suppression des log
+# Delete log
+SECURE_REMOVE '/var/log/$app/'
+# Delete cronlog
+SECURE_REMOVE '/etc/cron.d/$app'
# Remove user
sudo userdel -f $app