From 13406e34b1179d748b98791d1a15387ba053a4fa Mon Sep 17 00:00:00 2001 From: James Rayner Date: Mon, 7 Sep 2009 20:00:22 +1000 Subject: Lots of little tweaks that should never hurt. Some of them may help in corner cases; others probably make no difference. Signed-off-by: Jim Pryor --- src/net-profiles | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/net-profiles') diff --git a/src/net-profiles b/src/net-profiles index ba75d56..a60d30b 100644 --- a/src/net-profiles +++ b/src/net-profiles @@ -18,7 +18,7 @@ case "$1" in done # $NET env var is passed from the kernel boot line - [ ! "$NETWORKS_MENU_TIMEOUT" ] && NETWORKS_MENU_TIMEOUT=5 + [[ -z "$NETWORKS_MENU_TIMEOUT" ]] && NETWORKS_MENU_TIMEOUT=5 if [[ "$NET" = "menu" ]]; then if /usr/bin/netcfg-menu "$NETWORKS_MENU_TIMEOUT"; then @@ -26,7 +26,7 @@ case "$1" in add_daemon net-profiles exit 0 fi - elif [[ "$NET" ]]; then + elif [[ -n "$NET" ]]; then if /usr/bin/netcfg2 -c "$NET"; then echo "$NET" > "$STATE_DIR/net-profiles" # JP: user may want to disconnect profile by calling net-profiles stop add_daemon net-profiles @@ -45,7 +45,7 @@ case "$1" in break # if netcfg-menu was called but failed: exit for loop ;; *) # Either interface or profile - if [ "$network" = "${network#!}" ]; then # otherwise profile + if [[ "$network" = "${network#!}" ]]; then # otherwise profile if /usr/bin/netcfg2 -c "$network"; then echo "$network" > "$STATE_DIR/net-profiles" # JP: user may want to disconnect profile by calling net-profiles stop add_daemon net-profiles @@ -66,7 +66,7 @@ case "$1" in # shutdown any profiles started by netcfg (or from NET_PROFILES in rc.conf) # JP: only attempt to disconnect the profiles _this daemon_ was told to control - cat "${state_DIR}/net-profiles" 2>/dev/null | xargs -d'\n' /usr/bin/netcfg2 down # JP: use xargs in case any of the profile names contain spaces etc + cat "$STATE_DIR/net-profiles" 2>/dev/null | xargs -d'\n' /usr/bin/netcfg2 down # JP: use xargs in case any of the profile names contain spaces etc rm -f "$STATE_DIR/net-profiles" rm_daemon net-profiles ;; -- cgit v1.2.3-24-g4f1b