Skip to content

Instantly share code, notes, and snippets.

@baymac
Last active January 15, 2019 19:21
Show Gist options
  • Select an option

  • Save baymac/23b9bfa1716e34754d4aebabeb19b24c to your computer and use it in GitHub Desktop.

Select an option

Save baymac/23b9bfa1716e34754d4aebabeb19b24c to your computer and use it in GitHub Desktop.
if [ "$#" -eq 1 ]; then
case $1 in
-u| --unset)
reset_proxy
exit 0
;;
*)
exit_with_usage
;;
esac
elif [ "$#" -eq 4 ]; then
case $1 in
-h| --host)
shift
PROXY_HOST=$1
echo $PROXY_HOST
shift
case $1 in
-p| --port)
shift
PROXY_PORT=$1
echo $PROXY_PORT
shift
;;
*)
exit_with_usage
;;
esac
;;
*)
exit_with_usage
;;
esac
else
exit_with_usage
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment