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

[fix] Remove & Restore scripts.

This commit is contained in:
opi 2016-05-14 10:40:28 +02:00
parent d16152c984
commit 3aa6ca6cea
3 changed files with 16 additions and 12 deletions

View file

@ -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@<div id=\"toolbar-inspector\" title=\"Toggle Inspector\"></div>@<div id=\"toolbar-inspector\" title=\"Toggle Inspector\"></div><div id=\"toolbar-separator\"></div><a href=\"../../downloads/\" id=\"toolbar-downloads\" title=\"Downloads\" target=\"_blank\"></a>@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@<div id=\"toolbar-inspector\" title=\"Toggle Inspector\"></div>@<div id=\"toolbar-inspector\" title=\"Toggle Inspector\"></div><div id=\"toolbar-separator\"></div><a href=\"../../downloads/\" id=\"toolbar-downloads\" title=\"Downloads\" target=\"_blank\"></a>@g" /usr/share/transmission/web/index.html
# Configure Nginx and reload
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf

View file

@ -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

View file

@ -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