Add aliases for certain parameters.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-03-28 17:01:43 -07:00
parent 0d19c99699
commit 9713fe358b

View File

@ -27,12 +27,6 @@
################################################################################################
declare -A params
declare -A options
declare -u pn
if [ $# -eq 0 ]; then
echo "Usage: $0 <var>=<val> ..." >&2
exit 1
fi
getfileparams() {
while read option; do
@ -52,16 +46,35 @@ getfileparams() {
return 0
}
if [ $# -eq 0 ]; then
echo "Usage: $0 <var>=<val> ..." >&2
exit 1
fi
for p in $@; do
p=${p#--}
[ -n "${p}" ] && {
pn=${p%=*}
pv=${p#*=}
[ -n ${pn} ] && params[${pn}]="${pv}"
if [ -n ${pn} ]; then
case ${pn} in
VENDOR)
pn=HOST
;;
SHAREDSTATEDIR)
pn=VARDIR
;;
DATADIR)
pn=SHAREDIR
;;
esac
params[${pn}]="${pv}"
}
done
vendor=${params[HOST]}
if [ -z "$vendor" ]; then
rcfile=shorewallrc.default
vendor=linux