summaryrefslogtreecommitdiff
path: root/print/LPRng-core/files/LPRng.sh
diff options
context:
space:
mode:
Diffstat (limited to 'print/LPRng-core/files/LPRng.sh')
-rw-r--r--print/LPRng-core/files/LPRng.sh58
1 files changed, 58 insertions, 0 deletions
diff --git a/print/LPRng-core/files/LPRng.sh b/print/LPRng-core/files/LPRng.sh
new file mode 100644
index 00000000000..c6f2a4655da
--- /dev/null
+++ b/print/LPRng-core/files/LPRng.sh
@@ -0,0 +1,58 @@
+#!/bin/sh
+#
+# $NetBSD: LPRng.sh,v 1.1 2000/12/28 00:13:08 jlam Exp $
+#
+# PROVIDE: lpd
+# REQUIRE: DAEMON
+
+name="lpd"
+command=@@PREFIX@@/sbin/${name}
+pidfile="/var/run/${name}.pid"
+
+if [ -f ${pidfile} ]
+then
+ pid=`head -1 ${pidfile}`
+else
+ pid=`ps -ax | awk '{print $1,$5}' | grep ${name} | awk '{print $1}'`
+fi
+
+cmd=${1:-start}
+
+case ${cmd} in
+start)
+ if [ "$pid" = "" -a -x ${command} ]
+ then
+ echo "Starting LPRng."
+ ${command}
+ fi
+ ;;
+
+stop)
+ if [ "$pid" != "" ]
+ then
+ echo "Stopping LPRng."
+ kill $pid
+ fi
+ ;;
+
+restart)
+ ( $0 stop )
+ sleep 5
+ $0 start
+ ;;
+
+status)
+ if [ "$pid" != "" ]
+ then
+ echo "LPRng is running as pid ${pid}."
+ else
+ echo "LPRng is not running."
+ fi
+ ;;
+
+*)
+ echo 1>&2 "Usage: ${name} [restart|start|stop|status]"
+ exit 1
+ ;;
+esac
+exit 0