#!/bin/sh
-# Copyright 2006 Gentoo Foundation
# Copyright 2007 Roy Marples
# All rights reserved
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
local result=
while [ -n "$1" ]; do
case " ${result} " in
- *" $1 "*) ;;
- *) result="${result} $1" ;;
+ *" $1 "*);;
+ *) result="${result} $1";;
esac
shift
done
# 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
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
case "${LINE}" in
"nameserver "*)
case "${LINE#* }" in
- 127.*) continue ;;
+ 127.*) continue;;
esac
NS="${NS}${LINE#* } "
;;
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"