aboutsummaryrefslogtreecommitdiff
path: root/scripts/remove
diff options
context:
space:
mode:
authormagikcypress <cyp@rouquin.me>2017-04-18 02:47:58 +0200
committermagikcypress <cyp@rouquin.me>2017-04-18 02:47:58 +0200
commit128aa107baf2bbf713a6af43182e1bc6d9c7a1a7 (patch)
treec6ccfef70b81223ee61e28b2c6106a862c51ad8d /scripts/remove
parentcfdc9938e270ce9bd92446f628101f0b67db3e32 (diff)
downloadmastodon_ynh-128aa107baf2bbf713a6af43182e1bc6d9c7a1a7.tar.gz
mastodon_ynh-128aa107baf2bbf713a6af43182e1bc6d9c7a1a7.tar.bz2
mastodon_ynh-128aa107baf2bbf713a6af43182e1bc6d9c7a1a7.zip
[fix] secure rm + upgrade
Diffstat (limited to 'scripts/remove')
-rw-r--r--scripts/remove20
1 files changed, 9 insertions, 11 deletions
diff --git a/scripts/remove b/scripts/remove
index a65bf14..6ddf97b 100644
--- a/scripts/remove
+++ b/scripts/remove
@@ -17,7 +17,7 @@ domain=$(ynh_app_setting_get "$app" domain)
if [ -e "/etc/systemd/system/mastodon-web.service" ]; then
echo "Delete systemd script"
sudo systemctl stop mastodon-web.service
- sudo rm "/etc/systemd/system/mastodon-web.service"
+ ynh_secure_remove "/etc/systemd/system/mastodon-web.service"
sudo systemctl disable mastodon-web.service
fi
@@ -25,7 +25,7 @@ fi
if [ -e "/etc/systemd/system/mastodon-sidekiq.service" ]; then
echo "Delete systemd script"
sudo systemctl stop mastodon-sidekiq.service
- sudo rm "/etc/systemd/system/mastodon-sidekiq.service"
+ ynh_secure_remove "/etc/systemd/system/mastodon-sidekiq.service"
sudo systemctl disable mastodon-sidekiq.service
fi
@@ -33,7 +33,7 @@ fi
if [ -e "/etc/systemd/system/mastodon-streaming.service" ]; then
echo "Delete systemd script"
sudo systemctl stop mastodon-sidekiq.streaming
- sudo rm "/etc/systemd/system/mastodon-streaming.service"
+ ynh_secure_remove "/etc/systemd/system/mastodon-streaming.service"
sudo systemctl disable mastodon-streaming.service
fi
@@ -73,27 +73,25 @@ sudo apt-get remove --purge -y yarn
#sudo apt-get remove --purge -y autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev
# Delete app directory and configurations
-SECURE_REMOVE '/opt/$app'
+ynh_secure_remove /opt/$app
[[ -n $domain ]] && sudo rm -f "/etc/nginx/conf.d/${domain}.d/${app}.conf"
# Delete nginx configuration
REMOVE_NGINX_CONF
-# Delete log
-SECURE_REMOVE '/var/log/$app/'
# Delete cronlog
-SECURE_REMOVE '/etc/cron.d/$app'
+ynh_secure_remove /etc/cron.d/$app
# Delete source.list
-sudo rm /etc/apt/sources.list.d/backports.list
-sudo rm /etc/apt/sources.list.d/yarn.list
+ynh_secure_remove /etc/apt/sources.list.d/backports.list
+ynh_secure_remove /etc/apt/sources.list.d/yarn.list
# Delete ruby exec
-sudo rm /usr/bin/ruby
+ynh_secure_remove /usr/bin/ruby
# Remove user
sudo userdel -f $app
# Reload services
-sudo service nginx reload
+sudo systemctl reload nginx
echo -e "\e[0m" # Restore normal color