kill 2>/dev/null as we just interested in if we can signal it or not.
[openresolv] / resolvconf.in
index 52b30d6964318d927535b6b219bd9e466eb395bb..06f460fa7eaf7cf5d9712828dcec91aa5051718c 100755 (executable)
@@ -1,5 +1,4 @@
 #!/bin/sh
-# Copyright 2006 Gentoo Foundation
 # Copyright 2007 Roy Marples
 # All rights reserved
 
@@ -75,8 +74,8 @@ uniqify() {
     local result=
     while [ -n "$1" ]; do
                case " ${result} " in
-                       *" $1 "*) ;;
-                       *) result="${result} $1" ;;
+                       *" $1 "*);;
+                       *) result="${result} $1";;
                esac
                shift
        done
@@ -105,11 +104,11 @@ if [ "x${CMD}" = "x-s" ]; then
        # If restarting check if service is running or not if we can
        if [ "x${ACTION}" = "xrestart" ]; then
                if [ -s /var/run/"${SERVICE}".pid ]; then
-                       kill -0 $(cat /var/run/"${SERVICE}".pid)
+                       kill -0 $(cat /var/run/"${SERVICE}".pid) 2>/dev/null
                elif [ -s /var/run/"${SERVICE}"/"${SERVICE}".pid ]; then
-                       kill -0 $(cat /var/run/"${SERVICE}".pid)
+                       kill -0 $(cat /var/run/"${SERVICE}".pid) 2>/dev/null
                elif [ -s /var/run/"${SERVICE}"/pid ]; then
-                       kill -0 $(cat /var/run/"${SERVICE}"/pid)
+                       kill -0 $(cat /var/run/"${SERVICE}"/pid) 2>/dev/null
                else
                        false
                fi
@@ -141,8 +140,7 @@ if [ -n "$1" ]; then
        shift
 fi
 
-# -l is a Gentoo option that lists our resolv files
-# optionally for a specific interface
+# -l lists our resolv files, optionally for a specific interface
 if [ "x${CMD}" = "x-l" -o "x${CMD}" = "x-i" ]; then
        [ -d "${IFACEDIR}" ] || exit 0
        
@@ -188,7 +186,7 @@ if [ "x${CMD}" = "x-v" ]; then
                case "${LINE}" in
                        "nameserver "*)
                                case "${LINE#* }" in
-                                       127.*) continue ;;
+                                       127.*) continue;;
                                esac
                                NS="${NS}${LINE#* } "
                                ;;
@@ -253,12 +251,12 @@ fi
 if [ "x${CMD}" = "x-a" ]; then
        for x in '/' \\ ' ' '*'; do
                case "${IFACE}" in
-                       *[${x}]*) error_exit "${x} not allowed in interface name" ;;
+                       *[${x}]*) error_exit "${x} not allowed in interface name";;
                esac
        done
        for x in '.' '-' '~'; do
                case "${IFACE}" in
-                       [${x}]*) error_exit "${x} not allowed at start of interface name" ;;
+                       [${x}]*) error_exit "${x} not allowed at start of interface name";;
                esac
        done
        [ "x${CMD}" = "x-a" -a -t 0 ] && error_exit "No file given via stdin"