1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-13 19:11:51 +00:00
openmptcprouter-feeds/luci-app-openmptcprouter/root/etc/init.d/openmptcprouter

36 lines
1.1 KiB
Text
Raw Normal View History

2018-04-17 07:27:15 +00:00
#!/bin/sh /etc/rc.common
START=5
USE_PROCD=1
start_service() {
local scaling_min_freq scaling_max_freq
config_load openmptcprouter
config_get scaling_min_freq settings scaling_min_freq
[ -n "$scaling_min_freq" ] && {
2018-04-17 12:48:55 +00:00
for c in $(ls -d /sys/devices/system/cpu/cpufreq/policy[0-9]*); do
echo $scaling_min_freq > $c/scaling_min_freq
done
2018-04-17 07:27:15 +00:00
}
config_get scaling_max_freq settings scaling_max_freq
[ -n "$scaling_max_freq" ] && {
2018-04-17 12:48:55 +00:00
for c in $(ls -d /sys/devices/system/cpu/cpufreq/policy[0-9]*); do
echo $scaling_max_freq > $c/scaling_max_freq
done
2018-04-17 07:27:15 +00:00
}
config_get scaling_governor settings scaling_governor
[ -n "$scaling_governor" ] && {
2018-04-17 12:48:55 +00:00
for c in $(ls -d /sys/devices/system/cpu/cpufreq/policy[0-9]*); do
echo $scaling_governor > $c/scaling_governor
done
2018-04-17 07:27:15 +00:00
}
2018-05-12 08:07:51 +00:00
# remove sysctl already defined in /etc/sysctl.d/
sed -i -e '/tcp_fin_timeout/d' -e '/tcp_keepalive_time/d' -e '/nf_conntrack_max/d' /etc/sysctl.conf
2018-06-14 20:39:42 +00:00
sed -i -e '/tcp_fin_timeout/d' -e '/tcp_keepalive_time/d' -e '/nf_conntrack_max/d' /etc/sysctl.d/10-default.conf
2018-04-17 07:27:15 +00:00
}
reload_service() {
rc_procd start_service
return 0
}