net-firewall/shorewall: fix bashisms in init.d script
authorThomas Deutschmann <whissi@gentoo.org>
Tue, 20 Dec 2016 14:12:13 +0000 (15:12 +0100)
committerThomas Deutschmann <whissi@gentoo.org>
Tue, 20 Dec 2016 14:18:52 +0000 (15:18 +0100)
Package-Manager: Portage-2.3.2, Repoman-2.3.1

net-firewall/shorewall/files/shorewall-lite.initd-r2
net-firewall/shorewall/files/shorewall.initd-r2

index 689f94b38463cfb061a8bc5600db50f540491f24..7777e3b99d65575c128d1887af3194562aba7a94 100644 (file)
@@ -3,7 +3,7 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-if [[ "${RC_SVCNAME}" == "shorewall6-lite" ]]; then
+if [ "${RC_SVCNAME}" = "shorewall6-lite" ]; then
        PRODUCT_NAME="Shorewall6-Lite"
        command="/usr/sbin/shorewall6-lite"
 else
@@ -51,9 +51,11 @@ reset() {
 }
 
 restart() {
+       local _retval
        ebegin "Restarting ${RC_SVCNAME}"
        ${command} status 1>/dev/null
-       if [ $? != 0 ] ; then
+       _retval=$?
+       if [ ${_retval} = '0' ]; then
                svc_start
        else
                ${command} ${OPTIONS} restart ${RESTARTOPTIONS} 1>/dev/null
index c23bfb75c58678748249a29b59a6ee202da7c18d..fa02b141588feeb58a9aa34111859b3686710dc4 100644 (file)
@@ -3,7 +3,7 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-if [[ "${RC_SVCNAME}" == "shorewall6" ]]; then
+if [ "${RC_SVCNAME}" = "shorewall6" ]; then
        PRODUCT_NAME="Shorewall6"
        command="/usr/sbin/shorewall6"
 else
@@ -68,9 +68,11 @@ reset() {
 }
 
 restart() {
+       local _retval
        ebegin "Restarting ${RC_SVCNAME}"
        ${command} status 1>/dev/null
-       if [ $? != 0 ] ; then
+       _retval=$?
+       if [ ${_retval} = '0' ]; then
                svc_start
        else
                ${command} ${OPTIONS} restart ${RESTARTOPTIONS} 1>/dev/null