mirror of
https://github.com/ben-grande/qusal.git
synced 2025-06-06 22:08:57 -04:00
fix: help option for port forwarder
This commit is contained in:
parent
80638d64b5
commit
6bf9b97a36
1 changed files with 5 additions and 1 deletions
|
@ -243,12 +243,15 @@ hook_dir="/rw/config/network-hooks.d"
|
||||||
hook_prefix="${hook_dir}/90-port-forward-"
|
hook_prefix="${hook_dir}/90-port-forward-"
|
||||||
persistent=""
|
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
|
echo "An error occurred while parsing options." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
eval set -- "${OPTS}"
|
eval set -- "${OPTS}"
|
||||||
|
if test "${OPTS}" = " --"; then
|
||||||
|
usage
|
||||||
|
fi
|
||||||
while test "${#}" -gt "0"; do
|
while test "${#}" -gt "0"; do
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
-a|--action) action="${2}"; shift;;
|
-a|--action) action="${2}"; shift;;
|
||||||
|
@ -256,6 +259,7 @@ while test "${#}" -gt "0"; do
|
||||||
-p|--port) port="${2}"; shift;;
|
-p|--port) port="${2}"; shift;;
|
||||||
-n|--proto) proto="${2}"; shift;;
|
-n|--proto) proto="${2}"; shift;;
|
||||||
-s|--persistent) persistent=1; shift;;
|
-s|--persistent) persistent=1; shift;;
|
||||||
|
-h|--help) usage;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue