mirror of
https://github.com/YunoHost-Apps/transmission_ynh.git
synced 2024-09-04 01:46:12 +02:00
Do not use sysctl.d into LXC
This commit is contained in:
parent
dd6257486d
commit
9c4e8736ff
5 changed files with 26 additions and 13 deletions
|
@ -42,7 +42,10 @@ 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"
|
||||
if [ -e /proc/sys/net/core/rmem_max ]
|
||||
then
|
||||
ynh_backup --src_path="/etc/sysctl.d/90-transmission.conf"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# BACKUP DATA
|
||||
|
|
|
@ -129,8 +129,9 @@ 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
|
||||
if [ -e /proc/sys/net/core/rmem_max ]; then
|
||||
if [ -e /proc/sys/net/core/rmem_max ]
|
||||
then
|
||||
cp ../conf/90-transmission.conf /etc/sysctl.d/90-transmission.conf
|
||||
sysctl --load=/etc/sysctl.d/90-transmission.conf
|
||||
fi
|
||||
|
||||
|
@ -139,7 +140,10 @@ fi
|
|||
#=================================================
|
||||
|
||||
ynh_store_file_checksum --file=/etc/transmission-daemon/settings.json
|
||||
ynh_store_file_checksum --file=/etc/sysctl.d/90-transmission.conf
|
||||
if [ -e /proc/sys/net/core/rmem_max ]
|
||||
then
|
||||
ynh_store_file_checksum --file=/etc/sysctl.d/90-transmission.conf
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# YUNOHOST MULTIMEDIA INTEGRATION
|
||||
|
|
|
@ -76,8 +76,9 @@ 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
|
||||
if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then
|
||||
if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]
|
||||
then
|
||||
ynh_secure_remove --file=/etc/sysctl.d/90-transmission.conf
|
||||
sysctl --load=/etc/sysctl.d/90-transmission.conf
|
||||
fi
|
||||
|
||||
|
|
|
@ -73,8 +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 --origin_path="/etc/sysctl.d/90-transmission.conf"
|
||||
if [ -e /proc/sys/net/core/rmem_max ]; then
|
||||
if [ -e /proc/sys/net/core/rmem_max ]
|
||||
then
|
||||
ynh_restore_file --origin_path="/etc/sysctl.d/90-transmission.conf"
|
||||
sysctl --load=/etc/sysctl.d/90-transmission.conf
|
||||
fi
|
||||
|
||||
|
|
|
@ -134,11 +134,12 @@ 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
|
||||
if [ -e /proc/sys/net/core/rmem_max ]
|
||||
then
|
||||
# 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
|
||||
if [ -e /proc/sys/net/core/rmem_max ]; then
|
||||
cp ../conf/90-transmission.conf /etc/sysctl.d/90-transmission.conf
|
||||
sysctl --load=/etc/sysctl.d/90-transmission.conf
|
||||
fi
|
||||
|
||||
|
@ -148,7 +149,10 @@ fi
|
|||
|
||||
# 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
|
||||
if [ -e /proc/sys/net/core/rmem_max ]
|
||||
then
|
||||
ynh_store_file_checksum --file=/etc/sysctl.d/90-transmission.conf
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# YUNOHOST MULTIMEDIA INTEGRATION
|
||||
|
|
Loading…
Add table
Reference in a new issue