Skip to content

Commit

Permalink
Fix getopts usage. Avoid LC_COLLATE problems
Browse files Browse the repository at this point in the history
  • Loading branch information
vaeth committed Sep 26, 2016
1 parent 1d9f1a8 commit 36985e7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion etc/firewall.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# We make use of "[0-9]" in this config, so we need correct LC_COLLATE:
unset LC_ALL
LC_COLLATE=C
export LC_COLLATE=C

# In order to configure, one might need the active sshd port "$SSHPORT":
# This port is read from /etc/ssh/sshd_config (default: "ssh")
Expand Down
3 changes: 2 additions & 1 deletion sbin/firewall
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ doexec=
kernelset=:
use_restore=:
OPTIND=1
while getopts '1ksSpPa:A:Hh?' opt
while getopts '1ksSpPa:A:Hh' opt
do case $opt in
1) use_restore=false;;
k) kernelset=false;;
Expand All @@ -347,6 +347,7 @@ do case $opt in
P) PORTKNOCK=:;;
a) Push ALLOWTCP "$OPTARG";;
A) Push ALLOWUDP "$OPTARG";;
'?') exit 1;;
*) Usage 0;;
esac
done
Expand Down
2 changes: 1 addition & 1 deletion zsh/_firewall
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
local context state state_descr line
typeset -A opt_args
_arguments -s -S -A '-*' : \
'(1 -)'{'-h','-\\?'}'[help]' \
'(1 -)-h[help]' \
'-k[skip calling sysctl.net]' \
'(-S)-s[show only what would be executed]' \
'(-s)-S[show before executing]' \
Expand Down

0 comments on commit 36985e7

Please sign in to comment.