Skip to content

Commit

Permalink
fix: help option for port forwarder
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-grande committed Jan 16, 2024
1 parent e1aed55 commit c96d30a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion salt/sys-syncthing/files/admin/firewall/qvm-port-forward
Original file line number Diff line number Diff line change
Expand Up @@ -243,19 +243,23 @@ hook_dir="/rw/config/network-hooks.d"
hook_prefix="${hook_dir}/90-port-forward-"
persistent=""

if ! OPTS=$(getopt -o a:q:p:n:s --long action:,qube:,port:,proto:,persistent -n "${0}" -- "${@}"); then
if ! OPTS=$(getopt -o h,a:q:p:n:s --long help,action:,qube:,port:,proto:,persistent -n "${0}" -- "${@}"); then
echo "An error occurred while parsing options." >&2
exit 1
fi

eval set -- "${OPTS}"
if test "${OPTS}" = " --"; then
usage
fi
while test "${#}" -gt "0"; do
case "${1}" in
-a|--action) action="${2}"; shift;;
-q|--qube) target_qube="${2}"; shift;;
-p|--port) port="${2}"; shift;;
-n|--proto) proto="${2}"; shift;;
-s|--persistent) persistent=1; shift;;
-h|--help) usage;;
esac
shift
done
Expand Down

0 comments on commit c96d30a

Please sign in to comment.