Browse Source

transmission: make the memory percentage allowed configurable

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
lilik-openwrt-22.03
Nikos Mavrogiannopoulos 10 years ago
parent
commit
6091831a5b
2 changed files with 8 additions and 5 deletions
  1. +1
    -0
      net/transmission/files/transmission.config
  2. +7
    -5
      net/transmission/files/transmission.init

+ 1
- 0
net/transmission/files/transmission.config View File

@ -2,6 +2,7 @@ config transmission
option enabled 0
option config_dir '/tmp/transmission'
#option user 'nobody'
option mem_percentage 50
option alt_speed_down 50
option alt_speed_enabled false
option alt_speed_time_begin 540


+ 7
- 5
net/transmission/files/transmission.init View File

@ -44,21 +44,23 @@ section_enabled() {
transmission() {
local cfg="$1"
#give transmission 3/5 of the memory of the system
local USE
local MEM=`grep MemTotal /proc/meminfo|sed 's/ \+/ /g'|cut -d ' ' -f 2`
if test "$MEM" -gt 1;then
USE=`expr $MEM \* 3000 / 5`
fi
local user
local download_dir
local mem_percentage
section_enabled "$section" || return 1
config_get config_dir "$cfg" 'config_dir' '/var/etc/transmission'
config_get user "$cfg" 'user'
config_get download_dir "$cfg" 'download_dir' '/var/etc/transmission'
config_get mem_percentage "$cfg" 'mem_percentage' '50'
local MEM=$(grep MemTotal /proc/meminfo|sed 's/ \+/ /g'|cut -d ' ' -f 2)
if test "$MEM" -gt 1;then
USE=$(expr $MEM \* $mem_percentage \* 10)
fi
config_file="$config_dir/settings.json"
[ -d $config_dir ] || {


Loading…
Cancel
Save