diff --git a/Shorewall-init/shorewall-init.spec b/Shorewall-init/shorewall-init.spec index a0f87b94f..e6f289e24 100644 --- a/Shorewall-init/shorewall-init.spec +++ b/Shorewall-init/shorewall-init.spec @@ -77,8 +77,8 @@ if [ $1 -eq 0 ]; then /sbin/chkconfig --del shorewall-init fi - [ -f /sbin/ifup-local ] && $(ls -l /sbin/ifup-local) | grep -q /usr/share/shorewall-init && rm -f /sbin/ifup-local - [ -f /sbin/ifdown-local ] && $(ls -l /sbin/ifdown-local) | grep -q /usr/share/shorewall-init && rm -f /sbin/ifdown-local + [ "$(readdir /sbin/ifup-local)" = /usr/share/shorewall-init ] && rm -f /sbin/ifup-local + [ "$(readdir /sbin/ifdown-local)" = /usr/share/shorewall-init ] && rm -f /sbin/ifdown-local rm -f /etc/sysconfig/network/if-up.d/shorewall rm -f /etc/sysconfig/network/if-down.d/shorewall diff --git a/Shorewall-init/uninstall.sh b/Shorewall-init/uninstall.sh index bbd0ce7f2..bb9ee2836 100755 --- a/Shorewall-init/uninstall.sh +++ b/Shorewall-init/uninstall.sh @@ -76,8 +76,8 @@ if [ -n "$INITSCRIPT" ]; then remove_file $INITSCRIPT fi -[ -f /sbin/ifup-local ] && $(ls -l /sbin/ifup-local) | grep -q /usr/share/shorewall-init && remove_file /sbin/ifup-local -[ -f /sbin/ifdown-local ] && $(ls -l /sbin/ifdown-local) | grep -q /usr/share/shorewall-init && remove_file /sbin/ifdown-local +[ "$(readlink /sbin/ifup-local)" = /usr/share/shorewall-init ] && remove_file /sbin/ifup-local +[ "$(readlink /sbin/ifdown-local)" = /usr/share/shorewall-init ] && remove_file /sbin/ifdown-local remove_file /etc/default/shorewall-init remove_file /etc/sysconfig/shorewall-init diff --git a/Shorewall-lite/uninstall.sh b/Shorewall-lite/uninstall.sh index 063c078de..f25fef7bb 100755 --- a/Shorewall-lite/uninstall.sh +++ b/Shorewall-lite/uninstall.sh @@ -79,7 +79,7 @@ if qt iptables -L shorewall -n && [ ! -f /sbin/shorewall ]; then fi if [ -L /usr/share/shorewall-lite/init ]; then - FIREWALL=$(ls -l /usr/share/shorewall-lite/init | sed 's/^.*> //') + FIREWALL=$(readlink /usr/share/shorewall-lite/init) else FIREWALL=/etc/init.d/shorewall-lite fi diff --git a/Shorewall/uninstall.sh b/Shorewall/uninstall.sh index 4f7899a77..4dc6f88e1 100755 --- a/Shorewall/uninstall.sh +++ b/Shorewall/uninstall.sh @@ -79,7 +79,7 @@ if qt iptables -L shorewall -n && [ ! -f /sbin/shorewall-lite ]; then fi if [ -L /usr/share/shorewall/init ]; then - FIREWALL=$(ls -l /usr/share/shorewall/init | sed 's/^.*> //') + FIREWALL=$(readlink /usr/share/shorewall/init) else FIREWALL=/etc/init.d/shorewall fi diff --git a/Shorewall6-lite/uninstall.sh b/Shorewall6-lite/uninstall.sh index da62ec537..36e8fc761 100755 --- a/Shorewall6-lite/uninstall.sh +++ b/Shorewall6-lite/uninstall.sh @@ -67,7 +67,7 @@ if qt ip6tables -L shorewall -n && [ ! -f /sbin/shorewall6 ]; then fi if [ -L /usr/share/shorewall6-lite/init ]; then - FIREWALL=$(ls -l /usr/share/shorewall6-lite/init | sed 's/^.*> //') + FIREWALL=$(readlink /usr/share/shorewall6-lite/init) else FIREWALL=/etc/init.d/shorewall6-lite fi diff --git a/Shorewall6/uninstall.sh b/Shorewall6/uninstall.sh index b94d4a8ec..231a9b867 100755 --- a/Shorewall6/uninstall.sh +++ b/Shorewall6/uninstall.sh @@ -79,7 +79,7 @@ if qt ip6tables -L shorewall6 -n && [ ! -f /sbin/shorewall6-lite ]; then fi if [ -L /usr/share/shorewall6/init ]; then - FIREWALL=$(ls -l /usr/share/shorewall6/init | sed 's/^.*> //') + FIREWALL=$(readlink /usr/share/shorewall6/init) else FIREWALL=/etc/init.d/shorewall6 fi