mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-07-28 03:01:54 +08:00
32 lines
676 B
Plaintext
32 lines
676 B
Plaintext
[ ! -f "/usr/share/ucitrack/luci-app-floatip.json" ] && {
|
|
cat > /usr/share/ucitrack/luci-app-floatip.json << EEOF
|
|
{
|
|
"config": "floatip",
|
|
"init": "floatip"
|
|
}
|
|
EEOF
|
|
}
|
|
uci -q batch <<-EOF >/dev/null
|
|
delete ucitrack.@floatip[-1]
|
|
add ucitrack floatip
|
|
set ucitrack.@floatip[-1].init=floatip
|
|
commit ucitrack
|
|
EOF
|
|
|
|
uci -q batch <<-EOF >/dev/null
|
|
delete network.floatip
|
|
commit network
|
|
EOF
|
|
|
|
# don't change role if enabled
|
|
[[ "`uci -q get floatip.main.enabled`" = "1" ]] && exit 0
|
|
|
|
[[ "`uci -q get network.lan.proto`" = "static" && -n "`uci -q get network.lan.gateway`" ]] || exit 0
|
|
|
|
uci -q batch <<-EOF >/dev/null
|
|
set floatip.main.role=main
|
|
commit floatip
|
|
EOF
|
|
|
|
exit 0
|