mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-13 19:11:51 +00:00
34 lines
No EOL
1.1 KiB
Bash
Executable file
34 lines
No EOL
1.1 KiB
Bash
Executable file
#!/bin/sh
|
|
uci -q batch <<-EOF >/dev/null
|
|
set system.@system[-1].ttylogin=1
|
|
set system.ntp.use_dhcp='0'
|
|
set system.ntp.enable_server='1'
|
|
commit system
|
|
set rpcd.@rpcd[0].timeout=120
|
|
commit rpcd
|
|
set luci.apply.timeout='20'
|
|
commit luci
|
|
EOF
|
|
|
|
if [ "$(uci -q get rpcd.@rpcd[0].socket)" != "/var/run/ubus/ubus.sock" ]; then
|
|
uci -q batch <<-EOF >/dev/null
|
|
set rpcd.@rpcd[0].socket='/var/run/ubus/ubus.sock'
|
|
commit rpcd
|
|
EOF
|
|
fi
|
|
|
|
/sbin/block detect > /etc/config/fstab
|
|
uci -q batch <<-EOF >/dev/null
|
|
set fstab.@global[0].check_fs='1'
|
|
commit fstab
|
|
EOF
|
|
|
|
[ -n "$(ubus call system board | jsonfilter -e '@.board_name' | grep raspberry)" ] && [ "$(uci -q get openmptcprouter.settings.scaling_governor)" != "performance" ] && {
|
|
# force CPU speed for RPI
|
|
uci -q set openmptcprouter.settings.scaling_min_freq=$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq | tr -d "\n")
|
|
uci -q set openmptcprouter.settings.scaling_max_freq=$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq | tr -d "\n")
|
|
uci -q set openmptcprouter.settings.scaling_governor='performance'
|
|
uci -q commit openmptcprouter
|
|
}
|
|
|
|
exit 0 |