File tree 1 file changed +7
-7
lines changed
ffac-wg-registration/files/lib/gluon/wg-registration
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
- if [ " $( uci get gluon.mesh_vpn.enabled) " == " true" ] || [ " $( uci get gluon.mesh_vpn.enabled) " = = " 1" ]; then
4
- # check if registration has been done since last boot
5
- if [ ! -f /tmp/WG_REGISTRATION_SUCCESSFUL ]; then
3
+ if [ " $( uci get gluon.mesh_vpn.enabled) " = " true" ] || [ " $( uci get gluon.mesh_vpn.enabled) " = " 1" ]; then
4
+ # check if registration has been done since last boot
5
+ if [ ! -f /tmp/WG_REGISTRATION_SUCCESSFUL ]; then
6
6
# Push public key to broker, test for https and use if supported
7
- wget -q https://[::1]
7
+ wget -q " https://[::1]"
8
8
if [ $? -eq 1 ]; then
9
9
PROTO=http
10
10
else
@@ -14,10 +14,10 @@ if [ "$(uci get gluon.mesh_vpn.enabled)" == "true" ] || [ "$(uci get gluon.mesh_
14
14
NODENAME=$( uci get system.@system[0].hostname)
15
15
BROKER=$( uci get wireguard.mesh_vpn.broker)
16
16
logger -t wg-registration " Post $NODENAME and $PUBLICKEY to $PROTO ://$BROKER "
17
- gluon-wan wget -q -O- --post-data=' {"node_name": "' " $NODENAME " ' ","public_key": "' " $PUBLICKEY " ' "}' $PROTO ://$BROKER
18
- if [ $? -eq 0 ] ; then
17
+ if gluon-wan wget -q -O- --post-data=' {"node_name": "' " $NODENAME " ' ","public_key": "' " $PUBLICKEY " ' "}' $PROTO ://" $BROKER "
18
+ then
19
19
touch /tmp/WG_REGISTRATION_SUCCESSFUL
20
20
logger -t wg-registration " successfully registered wg publickey"
21
21
fi
22
22
fi
23
- fi
23
+ fi
You can’t perform that action at this time.
0 commit comments