1
1
mirror of https://github.com/eblot/pybootd.git synced 2024-09-11 22:17:44 +03:00

Fix forward.sh script

This commit is contained in:
Emmanuel Blot 2011-05-24 14:32:16 +02:00
parent c216428e99
commit 5249ed9ef5

View File

@ -29,18 +29,53 @@ $NAME [options] <on|off>
EOT
}
ENABLE=0
# Parse the command line
while [ $# -ge 0 ]; do
case "$1" in
-h)
usage
exit 0
;;
-i)
shift
INTERFACE=$1
;;
-*)
usage
echo "Unsupported option: $1"
exit 1
;;
on)
ENABLE=1
;;
off)
ENABLE=0
;;
'')
break
;;
*)
usage
echo "Unsupported command: $1"
exit 1
;;
esac
shift
done
if [ -z "${WAN_IF}" ]; then
echo "Unknown WAN interface" >&2
exit 1
fi
UID=`id -u`
if [ ${UID} -ne 0 ]; then
echo "Superuser privileges are required" >&2
exit 1
fi
ENABLE=0
case "${OSTYPE}" in
darwin*)
if [ ${ENABLE} -eq 1 ]; then