mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-07-27 10:31:38 +08:00
20 lines
621 B
Bash
20 lines
621 B
Bash
#!/bin/sh
|
|
uci show luci | grep -E "luci.@command\[.+\.name='go-stun NAT Type Test'" >/dev/null
|
|
if [ "$?" == "1" ]; then
|
|
section=$(uci add luci command)
|
|
uci -q batch <<-EOF >/dev/null
|
|
set luci.$section.name='go-stun NAT Type Test'
|
|
set luci.$section.command='go-stun -s stun.syncthing.net:3478'
|
|
commit luci
|
|
EOF
|
|
fi
|
|
uci show luci | grep "name='go-stun NAT Behavior Test'" >/dev/null
|
|
if [ "$?" == "1" ]; then
|
|
section=$(uci add luci command)
|
|
uci -q batch <<-EOF >/dev/null
|
|
set luci.$section.name='go-stun NAT Behavior Test'
|
|
set luci.$section.command='go-stun -b -s stun.syncthing.net:3478'
|
|
commit luci
|
|
EOF
|
|
fi
|