diff options
Diffstat (limited to 'net-scripts/net')
-rw-r--r-- | net-scripts/net/iwconfig.sh | 4 | ||||
-rw-r--r-- | net-scripts/net/pppd.sh | 3 | ||||
-rw-r--r-- | net-scripts/net/udhcpc.sh | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/net-scripts/net/iwconfig.sh b/net-scripts/net/iwconfig.sh index e2ea7620..40930783 100644 --- a/net-scripts/net/iwconfig.sh +++ b/net-scripts/net/iwconfig.sh @@ -64,7 +64,7 @@ iwconfig_exists() { && return 0 [[ ! -e /proc/net/wireless ]] && return 1 - [[ $(</proc/net/wireless) =~ $'\n'"[ \t]*$1:" ]] + grep -q "^[ \t]*$1:" /proc/net/wireless } # char* iwconfig_get_wep_status(char *interface) @@ -74,7 +74,7 @@ iwconfig_exists() { iwconfig_get_wep_status() { local mode= status="disabled" - if [[ $(iwconfig "$1") =~ $'\n'" +Encryption key:[0-9,A-F]" ]]; then + if iwconfig "$1" | grep -qE "^ +Encryption key:[0-9,A-F]" ; then status="enabled" mode=$(iwconfig "$1" | sed -n -e 's/^.*Security mode:\(.*[^ ]\).*/\1/p') [[ -n ${mode} ]] && mode=" - ${mode}" diff --git a/net-scripts/net/pppd.sh b/net-scripts/net/pppd.sh index 7a19185b..3b3a5b96 100644 --- a/net-scripts/net/pppd.sh +++ b/net-scripts/net/pppd.sh @@ -177,7 +177,8 @@ pppd_start() { fi if [[ " ${opts} " == *" plugin pppoatm.so "* ]] ; then - if [[ ${!link} =~ '^[ \t]*([1-9]*[0-9]\.){1,2}[1-9]*[0-9][ \t]*$' ]] ; then + #if [[ ${!link} =~ '^[ \t]*([1-9]*[0-9]\.){1,2}[1-9]*[0-9][ \t]*$' ]] ; then + if echo "${!link}" | grep -qE '^[ \t]*([1-9]*[0-9]\.){1,2}[1-9]*[0-9][ \t]*$' ; then insert_link_in_opts=0 else ewarn "WARNING: An [itf.]vpi.vci ATM address was expected in ${link}" diff --git a/net-scripts/net/udhcpc.sh b/net-scripts/net/udhcpc.sh index c3741391..3dcf0610 100644 --- a/net-scripts/net/udhcpc.sh +++ b/net-scripts/net/udhcpc.sh @@ -82,7 +82,7 @@ udhcpc_start() { [[ -z ${!d} ]] && d="dhcp" if [[ " ${!d} " != *" nosendhost "* ]]; then - if [[ ! " ${opts}" =~ " -([hH] |-hostname=)" ]]; then + if [[ " ${opts} " != *" -"[hH]" "* && " ${opts} " != *" --hostname="* ]] ; then local hname=$(hostname) [[ -n ${hname} && ${hname} != "(none)" && ${hname} != "localhost" ]] \ && opts="${opts} --hostname=${hname}" |