op-packages/openwrt-go-stun/uci-defaults
github-actions[bot] 32600acc60 🌴 Sync 2026-03-05 23:51:42
2026-03-05 23:51:42 +08:00

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