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:
parent
d16152c984
commit
3aa6ca6cea
3 changed files with 16 additions and 12 deletions
|
@ -50,9 +50,9 @@ sudo service transmission-daemon reload
|
||||||
sudo yunohost service add transmission-daemon
|
sudo yunohost service add transmission-daemon
|
||||||
|
|
||||||
# Patch sources to add a download button
|
# Patch sources to add a download button
|
||||||
sudo cp ../sources/toolbar-downloads.png /usr/share/transmission/web/style/transmission/images/toolbar-downloads.png
|
# 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 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 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
|
# Configure Nginx and reload
|
||||||
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
||||||
|
|
|
@ -19,6 +19,8 @@ sudo rm -rf /home/yunohost.transmission
|
||||||
|
|
||||||
# Remove Debian package
|
# Remove Debian package
|
||||||
sudo apt-get remove -y -qq transmission-daemon
|
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
|
# Reload nginx and ssowatconf
|
||||||
sudo service nginx reload
|
sudo service nginx reload
|
||||||
|
|
|
@ -21,10 +21,11 @@ if [[ ! $? -eq 0 ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sources_path=/usr/share/transmission
|
sources_path=/usr/share/transmission
|
||||||
if [ -d $sources_path ]; then
|
# Do not check for empty source_path because 'apt-get remove' does not clean everything
|
||||||
echo "There is already a directory: $sources_path " | sudo tee /dev/stderr
|
# if [ -d $sources_path ]; then
|
||||||
exit 1
|
# echo "There is already a directory: $sources_path " | sudo tee /dev/stderr
|
||||||
fi
|
# exit 1
|
||||||
|
# fi
|
||||||
|
|
||||||
data_path=/home/yunohost.transmission
|
data_path=/home/yunohost.transmission
|
||||||
if [ -d $data_path ]; then
|
if [ -d $data_path ]; then
|
||||||
|
@ -39,10 +40,11 @@ if [ -f $nginx_conf ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
app_conf=/etc/transmission-daemon/settings.json
|
app_conf=/etc/transmission-daemon/settings.json
|
||||||
if [ -f $app_conf ]; then
|
# Do not check for empty app_conf because 'apt-get remove' does not clean everything
|
||||||
echo "There is already a PHP-FPM conf file at this path: $app_conf " | sudo tee /dev/stderr
|
# if [ -f $app_conf ]; then
|
||||||
exit 1
|
# echo "There is already a PHP-FPM conf file at this path: $app_conf " | sudo tee /dev/stderr
|
||||||
fi
|
# exit 1
|
||||||
|
# fi
|
||||||
|
|
||||||
# Open port in firewall
|
# Open port in firewall
|
||||||
sudo yunohost firewall allow TCP 51413 > /dev/null 2>&1
|
sudo yunohost firewall allow TCP 51413 > /dev/null 2>&1
|
||||||
|
@ -69,7 +71,7 @@ sudo cp -a "./data" $data_path
|
||||||
|
|
||||||
# Restore conf files
|
# Restore conf files
|
||||||
sudo cp -a "./conf/nginx.conf" $nginx_conf
|
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
|
# Reload Nginx
|
||||||
sudo service nginx reload
|
sudo service nginx reload
|
||||||
|
|
Loading…
Add table
Reference in a new issue