Skip to content

Commit

Permalink
Dirty fix for openmptcprouter config
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysurac committed Dec 14, 2023
1 parent 59953af commit fd35a90
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions openmptcprouter/files/etc/init.d/openmptcprouter-vps
Original file line number Diff line number Diff line change
Expand Up @@ -2311,13 +2311,18 @@ token() {
config_foreach _get_token server
}

_fix_server() {
uci -q rename openmptcprouter.$1=server
}

start_service() {
serversnb=0
wanips=""
serial=$(cat /proc/cpuinfo | grep Serial | awk '{print $3}')
[ -z "$serial" ] && [ -f "/usr/sbin/dmidecode" ] && serial=$(/usr/sbin/dmidecode -t 1 | egrep 'Serial' | awk '{print $3}')
uci -q set openmptcprouter.settings.serial=${serial}
config_load openmptcprouter
config_foreach _fix_server openmptcprouter
config_foreach _count_server server
config_foreach _get_local_wan_ip interface
config_foreach _config_service server
Expand Down

0 comments on commit fd35a90

Please sign in to comment.