mirror of
https://github.com/YunoHost-Apps/transmission_ynh.git
synced 2024-09-04 01:46:12 +02:00
Fix upgrade, remove and #13
This commit is contained in:
parent
6c088f616d
commit
3b0ddf4a5d
3 changed files with 30 additions and 3 deletions
|
@ -235,6 +235,20 @@ ynh_find_port () {
|
|||
echo $port
|
||||
}
|
||||
|
||||
# Delete a system user
|
||||
#
|
||||
# usage: ynh_system_user_delete user_name
|
||||
# | arg: user_name - Name of the system user that will be create
|
||||
ynh_system_user_delete () {
|
||||
if ynh_system_user_exists "$1" # Check if the user exists on the system
|
||||
then
|
||||
echo "Remove the user $1" >&2
|
||||
sudo userdel $1
|
||||
else
|
||||
echo "The user $1 was not found" >&2
|
||||
fi
|
||||
}
|
||||
|
||||
# Substitute/replace a string by another in a file
|
||||
#
|
||||
# usage: ynh_replace_string match_string replace_string target_file
|
||||
|
|
|
@ -25,7 +25,7 @@ peer_port=$(ynh_app_setting_get $app peer_port)
|
|||
# REMOVE TRANSMISSION-DAEMON
|
||||
#=================================================
|
||||
|
||||
sudo apt-get -y purge transmission-daemon
|
||||
ynh_package_autoremove transmission-daemon
|
||||
|
||||
#=================================================
|
||||
# DISABLE SERVICE IN ADMIN PANEL
|
||||
|
@ -66,4 +66,15 @@ fi
|
|||
sudo rm "/home/yunohost.multimedia/share/Torrents"
|
||||
sudo rm "/home/yunohost.multimedia/share/Torrent to download"
|
||||
|
||||
# Remove config
|
||||
ynh_secure_remove /etc/transmission-daemon
|
||||
# And data
|
||||
ynh_secure_remove /usr/share/transmission
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALISATION
|
||||
#=================================================
|
||||
# REMOVE DEDICATED USER
|
||||
#=================================================
|
||||
|
||||
ynh_system_user_delete debian-transmission
|
||||
|
|
|
@ -25,10 +25,12 @@ peer_port=$(ynh_app_setting_get $app peer_port)
|
|||
#=================================================
|
||||
|
||||
if [ -z $port ]; then
|
||||
ynh_app_setting_set $app port 9091
|
||||
port=9091
|
||||
ynh_app_setting_set $app port $port
|
||||
fi
|
||||
if [ -z $peer_port ]; then
|
||||
ynh_app_setting_set $app peer_port 51413
|
||||
peer_port=51413
|
||||
ynh_app_setting_set $app peer_port $peer_port
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue