From c3d899714c6e68ea13cb15a75829ba16ea6cf217 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Mon, 30 Apr 2007 13:19:26 +0000 Subject: Stop using the [ -z "$@" ] test, use [ $# = 0 ] instead, #176554. --- ChangeLog | 2 ++ conf.d.Linux/net.example | 2 +- net.Linux/arping.sh | 2 +- net.Linux/clip.sh | 4 ++-- net.Linux/pppd.sh | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f90c7305..cdd08e5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ 30 Apr 2007; Roy Marples : + Stop using the [ -z "$@" ] test, use [ $# = 0 ] instead, #176554. + /etc/init.d/foo start and stop no longer exit when service is fully started or stopped, #176452. diff --git a/conf.d.Linux/net.example b/conf.d.Linux/net.example index 6d016bfc..6934d6c1 100644 --- a/conf.d.Linux/net.example +++ b/conf.d.Linux/net.example @@ -990,7 +990,7 @@ # # 'from 216.113.223.51/32 to 192.168.1.0/24 table localnet priority 100' \ # #" # eval set -- $\rules_${IFVAR} -# if [ -n "$@" ] ; then +# if [ $# != 0 ] ; then # einfo "Adding IP policy routing rules" # eindent # # Ensure that the kernel supports policy routing diff --git a/net.Linux/arping.sh b/net.Linux/arping.sh index 763cb4ce..817f8b2d 100644 --- a/net.Linux/arping.sh +++ b/net.Linux/arping.sh @@ -44,7 +44,7 @@ arping_start() { einfo "Pinging gateways on ${IFACE} for configuration" eval $(_get_array "gateways_${IFVAR}") - if [ -z "$@" ] ; then + if [ $# = 0 ] ; then eerror "No gateways have been defined (gateways_${IFVAR}=\"...\")" return 1 fi diff --git a/net.Linux/clip.sh b/net.Linux/clip.sh index 5eab64c0..7d3fef9b 100644 --- a/net.Linux/clip.sh +++ b/net.Linux/clip.sh @@ -80,7 +80,7 @@ are_atmclip_svcs_running() { clip_pre_start() { eval $(_get_array "clip_${IFVAR}") - [ -z "$@" ] && return 0 + [ $# = 0 ] && return 0 if [ ! -r /proc/net/atm/arp ] ; then modprobe clip && sleep 2 @@ -110,7 +110,7 @@ clip_pre_start() { clip_post_start() { eval $(_get_array "clip_${IFVAR}") - [ -z "$@" ] && return 0 + [ $# = 0 ] && return 0 are_atmclip_svcs_running || return 1 diff --git a/net.Linux/pppd.sh b/net.Linux/pppd.sh index cf55951b..f1224dd8 100644 --- a/net.Linux/pppd.sh +++ b/net.Linux/pppd.sh @@ -114,7 +114,7 @@ pppd_pre_start() { [ -n "$1" ] && chatopts="${chatopts} -T '$1'" [ -n "$2" ] && chatopts="${chatopts} -U '$2'" eval $(_get_array "chat_${IFVAR}") - if [ -n "$@" ] ; then + if [ $# != 0 ] ; then opts="${opts} connect $(printf "'%s' " "${chatopts} $(printf "'%s' " "$@")")" fi -- cgit v1.2.3