Skip to content

Commit

Permalink
ffmuc-mesh-vpn-wireguard: move code together
Browse files Browse the repository at this point in the history
  • Loading branch information
T0biii authored Jun 18, 2024
1 parent ed68c70 commit 785359f
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ if [[ "${mesh_vpn_enabled}" == "0" ]]; then
exit 0
fi

# Some legacy code seem to have used "true" instead of the canonical "1".
# This should be overwritten by a gluon-reconfigure (see 400-mesh-vpn-wireguard)
if [[ "${mesh_vpn_enabled}" != "1" ]]; then
logger -p warn -t checkuplink "Invalid value for wireguard.mesh_vpn.enabled detected: '${mesh_vpn_enabled}'. Assuming enabled."
fi

if { set -C; true 2>/dev/null >/var/lock/checkuplink.lock; }; then
trap "rm -f /var/lock/checkuplink.lock" EXIT
else
Expand Down Expand Up @@ -209,12 +215,6 @@ is_connected() {

# start main logic

# Some legacy code seem to have used "true" instead of the canonical "1".
# This should be overwritten by a gluon-reconfigure (see 400-mesh-vpn-wireguard)
if [[ "${mesh_vpn_enabled}" != "1" ]]; then
logger -p warn -t checkuplink "Invalid value for wireguard.mesh_vpn.enabled detected: '${mesh_vpn_enabled}'. Assuming enabled."
fi

# Do we already have a private-key? If not generate one
if ! uci -q get wireguard.mesh_vpn.privatekey > /dev/null
then
Expand Down

0 comments on commit 785359f

Please sign in to comment.