X-Git-Url: https://roy.marples.name/git diff --git a/resolvconf.in b/resolvconf.in index 7980daa..06f460f 100755 --- a/resolvconf.in +++ b/resolvconf.in @@ -1,5 +1,4 @@ #!/bin/sh -# Copyright 2006 Gentoo Foundation # Copyright 2007 Roy Marples # All rights reserved @@ -56,7 +55,7 @@ usage() { pattern -v [\$PATTERN] echo NEWDOMAIN, NEWSEARCH and NEWNS variables to the console - -s \$SVC \$CMD Do \$CMD for the system service \$SVC + -s \$SVC \$CMD Do \$CMD for the system service \$SVC -h Show this help cruft EOF [ -z "$@" ] && exit 0 @@ -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"