Skip to content

Commit

Permalink
Merge pull request #26 from lisenet/fix-exit-with-error-when-no-route…
Browse files Browse the repository at this point in the history
…s-provided

Exit with error message when no routes have been provided
  • Loading branch information
lisenet authored Dec 3, 2024
2 parents b7684cd + 30fd028 commit 547a429
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bin/ovpn_genconfig
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ set +u
[ -z "$OVPN_PROTO" ] && OVPN_PROTO=udp
[ -z "$OVPN_PORT" ] && OVPN_PORT=1194
set -u
if [ "${#OVPN_ROUTES[@]}" == "0" ] && [ "$OVPN_DEFROUTE" == "0" ]; then
echo "Default route disabled (-d) but no other routes provided!"
echo "Use (-r) to provide a route when disabling the default route"
exit 1
fi

[ "${#OVPN_ROUTES[@]}" == "0" ] && [ "$OVPN_DEFROUTE" == "1" ]

# Preserve config
Expand Down

0 comments on commit 547a429

Please sign in to comment.