gluon-legacy: gluon-mesh-vpn-fastd: correctly set enabled state
This commit is contained in:
parent
5315f2126a
commit
69187ec3c2
|
@ -4,11 +4,13 @@
|
|||
|
||||
|
||||
SECRET=
|
||||
ENABLED=
|
||||
|
||||
|
||||
for config in @legacy.fastd_configs@; do
|
||||
if [ -z "$SECRET" ]; then
|
||||
SECRET="$(uci_get fastd "$config" secret)"
|
||||
ENABLED="$(uci_get fastd "$config" enabled)"
|
||||
fi
|
||||
|
||||
uci_remove fastd "$config"
|
||||
|
@ -17,6 +19,10 @@ done
|
|||
if [ -n "$SECRET" ]; then
|
||||
uci_add fastd fastd 'mesh_vpn'
|
||||
uci_set fastd 'mesh_vpn' 'secret' "$SECRET"
|
||||
|
||||
if [ "$ENABLED" = 1 ]; then
|
||||
uci_set fastd 'mesh_vpn' 'enabled' '1'
|
||||
fi
|
||||
fi
|
||||
|
||||
uci_commit fastd
|
||||
|
|
Loading…
Reference in New Issue