From 510a35b46c8628d222b04494ae860a9ff603ea65 Mon Sep 17 00:00:00 2001 From: teastep Date: Thu, 21 Aug 2003 14:48:49 +0000 Subject: [PATCH] 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 --- Shorewall/functions | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Shorewall/functions b/Shorewall/functions index 7b106c825..a562197d6 100755 --- a/Shorewall/functions +++ b/Shorewall/functions @@ -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 } #