forked from extern/shorewall_code
Allow chains with IP addresses as names -- improved version
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@722 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
90b5b607a6
commit
510a35b46c
@ -381,23 +381,23 @@ ip_vlsm() {
|
||||
|
||||
|
||||
#
|
||||
# Chain name base for an interface
|
||||
# Chain name base for an interface -- remove all periods from the passed name.
|
||||
#
|
||||
chain_base() #$1 = interface
|
||||
{
|
||||
local c=${1%%+*}
|
||||
|
||||
case $c in
|
||||
*.*.*.*)
|
||||
echo $c | sed 's/\./_/g'
|
||||
;;
|
||||
*.*)
|
||||
echo ${c%.*}_${c#*.}
|
||||
;;
|
||||
*)
|
||||
echo ${c:=common}
|
||||
;;
|
||||
esac
|
||||
while true; do
|
||||
case $c in
|
||||
*.*)
|
||||
c="${c%.*}_${c##*.}"
|
||||
;;
|
||||
*)
|
||||
echo ${c:=common}
|
||||
return
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user