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

Fix warning

This commit is contained in:
Kay0u 2019-05-09 11:07:57 +02:00
parent 8716132517
commit 1532fca40d
6 changed files with 20 additions and 1 deletions

View file

@ -0,0 +1,2 @@
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576

View file

@ -42,6 +42,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_script_progression --message="Backing up transmission configuration..."
ynh_backup --src_path="/etc/transmission-daemon/settings.json"
ynh_backup --src_path="/etc/sysctl.d/90-transmission.conf"
#=================================================
# BACKUP DATA

View file

@ -118,7 +118,6 @@ ynh_systemd_action --service_name=transmission-daemon --action=stop
rpcpassword=$(ynh_string_random)
ynh_app_setting_set --app=$app --key=rpcpassword --value="$rpcpassword"
ynh_replace_string --match_string="__RPC_PASSWORD_TO_CHANGE__" --replace_string="$rpcpassword" --target_file=../conf/settings.json
if [ "$path_url" != "/" ]
then
@ -130,11 +129,15 @@ ynh_replace_string --match_string="__PEER_PORT__" --replace_string="$peer_port"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/settings.json
cp ../conf/settings.json /etc/transmission-daemon/settings.json
cp ../conf/90-transmission.conf /etc/sysctl.d/90-transmission.conf
sysctl --system
#=================================================
# STORE THE CHECKSUM OF THE CONFIG FILE
#=================================================
ynh_store_file_checksum --file=/etc/transmission-daemon/settings.json
ynh_store_file_checksum --file=/etc/sysctl.d/90-transmission.conf
#=================================================
# YUNOHOST MULTIMEDIA INTEGRATION

View file

@ -75,6 +75,9 @@ ynh_script_progression --message="Removing transmission data..."
ynh_secure_remove --file=/usr/share/transmission
# And data
ynh_secure_remove --file=/var/lib/transmission-daemon
# Kernel parameters
ynh_secure_remove --file=/etc/sysctl.d/90-transmission.conf
sysctl --system
#=================================================
# GENERIC FINALISATION

View file

@ -73,6 +73,9 @@ ynh_systemd_action --service_name=transmission-daemon --action=stop
ynh_secure_remove --file=/etc/transmission-daemon/settings.json
ynh_restore_file --origin_path=/etc/transmission-daemon/settings.json
ynh_restore_file --src_path="/etc/sysctl.d/90-transmission.conf"
sysctl --system
#=================================================
# RESTORE DATA
#=================================================

View file

@ -134,12 +134,19 @@ ynh_replace_string --match_string="__PEER_PORT__" --replace_string="$peer_port"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/settings.json
cp ../conf/settings.json /etc/transmission-daemon/settings.json
# Verify the checksum and backup the file if it's different
ynh_backup_if_checksum_is_different --file=/etc/sysctl.d/90-transmission.conf
cp ../conf/90-transmission.conf /etc/sysctl.d/90-transmission.conf
sysctl --system
#=================================================
# STORE THE CHECKSUM OF THE CONFIG FILE
#=================================================
# Recalculate and store the config file checksum into the app settings
ynh_store_file_checksum --file=/etc/transmission-daemon/settings.json
ynh_store_file_checksum --file=/etc/sysctl.d/90-transmission.conf
#=================================================
# YUNOHOST MULTIMEDIA INTEGRATION