2 # Common setup for startup scripts.
4 # Copyright 1998-2002 Apple Computer, Inc.
7 #######################
8 # Configure the shell #
9 #######################
18 # Set command search path
20 PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/System/Library/CoreServices; export PATH
23 # Set the terminal mode
25 #if [ -x /usr/bin/tset ] && [ -f /usr/share/misc/termcap ]; then
26 # TERM=$(tset - -Q); export TERM
34 # Determine if the network is up by looking for any non-loopback
35 # internet network interfaces.
41 if [ -z "${NETWORKUP:=}" ]; then
42 test=$(ifconfig -a inet 2>/dev/null | sed -n -e '/127.0.0.1/d' -e '/0.0.0.0/d' -e '/inet/p' | wc -l)
43 if [ "${test}" -gt 0 ]; then
51 alias ConsoleMessage=echo
59 local pidfile="${PIDFILE:=/var/run/${program}.pid}"
62 if [ -f "${pidfile}" ]; then
63 pid=$(head -1 "${pidfile}")
64 if ! kill -0 "${pid}" 2> /dev/null; then
65 echo "Bad pid file $pidfile; deleting."
71 if [ -n "${pid}" ]; then
80 # Generic action handler
85 start ) StartService ;;
87 restart) RestartService ;;
88 * ) echo "$0: unknown argument: $1";;
92 ##########################
93 # Get host configuration #
94 ##########################