1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/transmission_ynh.git synced 2024-09-04 01:46:12 +02:00

Add remove and upgrade script

This commit is contained in:
Kload 2013-10-29 13:26:46 +00:00
parent 70b375114e
commit c4403a1804
2 changed files with 42 additions and 0 deletions

13
scripts/remove Normal file
View file

@ -0,0 +1,13 @@
#!/bin/bash
sudo service transmission-daemon stop
sudo yunohost firewall disallow TCP 51413
domain=$(sudo yunohost app setting transmission domain)
sudo rm /etc/nginx/conf.d/$domain.d/transmission.conf
sudo rm -rf /home/yunohost.transmission
sudo apt-get remove -y -qq transmission-daemon
sudo service nginx reload
sudo yunohost app ssowatconf

29
scripts/upgrade Normal file
View file

@ -0,0 +1,29 @@
#!/bin/bash
# Retrieve arguments
domain=$(sudo yunohost app setting transmission domain)
path=$(sudo yunohost app setting transmission path)
# Remove trailing "/" for next commands
path=${path%/}
# Upgrade official debian package
sudo apt-get install transmission-daemon -y -qq
# Make directories and set rights
sudo mkdir -p /home/yunohost.transmission/{progress,completed}
sudo chgrp debian-transmission /home/yunohost.transmission/{progress,completed}
sudo chmod 770 -R /home/yunohost.transmission/{progress,completed}
# Configure Transmission and reload
sed -i "s@/PATHTOCHANGE@$path@g" ../conf/settings.json
sudo cp ../conf/settings.json /etc/transmission-daemon/settings.json
sudo service transmission-daemon reload
# Open port in firewall
sudo yunohost firewall allow TCP 51413 > /dev/null 2>&1
# Configure Nginx and reload
sed -i "s@/PATHTOCHANGE@$path@g" ../conf/nginx.conf
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/transmission.conf
sudo service nginx reload