blob: d48a29208d9c407d9fcf20e847366f51aa58fea3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#!/bin/sh
#
# $NetBSD: cupsd.sh,v 1.1 2000/12/07 20:33:05 jlam Exp $
#
# PROVIDE: cupsd
# REQUIRE: DAEMON
name="cupsd"
command=@PREFIX@/sbin/${name}
pid=`ps -ax | awk '{print $1,$5}' | grep ${name} | awk '{print $1}'`
cmd=${1:-start}
case ${cmd} in
start|restart)
if [ "$pid" != "" ]
then
echo "Restarting ${name}."
kill -HUP $pid
else
echo "Starting ${name}."
${command}
fi
;;
stop)
if [ "$pid" != "" ]
then
echo "Stopping ${name}."
kill $pid
fi
;;
status)
if [ "$pid" != "" ]
then
echo "${name} is running as pid ${pid}."
else
echo "${name} is not running."
fi
;;
*)
echo 1>&2 "Usage: ${name} [restart|start|stop|status]"
exit 1
;;
esac
exit 0
|