From 3aa6ca6ceaa964a2eeabf5317c66d6494e70cdec Mon Sep 17 00:00:00 2001 From: opi Date: Sat, 14 May 2016 10:40:28 +0200 Subject: [PATCH] [fix] Remove & Restore scripts. --- scripts/install | 6 +++--- scripts/remove | 2 ++ scripts/restore | 20 +++++++++++--------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/scripts/install b/scripts/install index 163b8bd..0c028ce 100644 --- a/scripts/install +++ b/scripts/install @@ -50,9 +50,9 @@ sudo service transmission-daemon reload sudo yunohost service add transmission-daemon # Patch sources to add a download button -sudo cp ../sources/toolbar-downloads.png /usr/share/transmission/web/style/transmission/images/toolbar-downloads.png -sudo bash -c 'cat ../sources/ynh_common.css >> /usr/share/transmission/web/style/transmission/common.css' -sudo sed -i "s@
@
@g" /usr/share/transmission/web/index.html +# sudo cp ../sources/toolbar-downloads.png /usr/share/transmission/web/style/transmission/images/toolbar-downloads.png +# sudo bash -c 'cat ../sources/ynh_common.css >> /usr/share/transmission/web/style/transmission/common.css' +# sudo sed -i "s@
@
@g" /usr/share/transmission/web/index.html # Configure Nginx and reload sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf diff --git a/scripts/remove b/scripts/remove index 017db52..7df99c9 100644 --- a/scripts/remove +++ b/scripts/remove @@ -19,6 +19,8 @@ sudo rm -rf /home/yunohost.transmission # Remove Debian package sudo apt-get remove -y -qq transmission-daemon +# sudo rm -rf /usr/share/transmission +# sudo rm -rf /etc/transmission-daemon/settings.json # Reload nginx and ssowatconf sudo service nginx reload diff --git a/scripts/restore b/scripts/restore index f081c59..7122f3b 100644 --- a/scripts/restore +++ b/scripts/restore @@ -21,10 +21,11 @@ if [[ ! $? -eq 0 ]]; then fi sources_path=/usr/share/transmission -if [ -d $sources_path ]; then - echo "There is already a directory: $sources_path " | sudo tee /dev/stderr - exit 1 -fi +# Do not check for empty source_path because 'apt-get remove' does not clean everything +# if [ -d $sources_path ]; then +# echo "There is already a directory: $sources_path " | sudo tee /dev/stderr +# exit 1 +# fi data_path=/home/yunohost.transmission if [ -d $data_path ]; then @@ -39,10 +40,11 @@ if [ -f $nginx_conf ]; then fi app_conf=/etc/transmission-daemon/settings.json -if [ -f $app_conf ]; then - echo "There is already a PHP-FPM conf file at this path: $app_conf " | sudo tee /dev/stderr - exit 1 -fi +# Do not check for empty app_conf because 'apt-get remove' does not clean everything +# if [ -f $app_conf ]; then +# echo "There is already a PHP-FPM conf file at this path: $app_conf " | sudo tee /dev/stderr +# exit 1 +# fi # Open port in firewall sudo yunohost firewall allow TCP 51413 > /dev/null 2>&1 @@ -69,7 +71,7 @@ sudo cp -a "./data" $data_path # Restore conf files sudo cp -a "./conf/nginx.conf" $nginx_conf -sudo cp -a "./conf/transmission.conf" $app_conf +sudo cp -a "./conf/transmission.json" $app_conf # Reload Nginx sudo service nginx reload