summaryrefslogtreecommitdiff
path: root/net-print/lprng/files/lprng-init
diff options
context:
space:
mode:
Diffstat (limited to 'net-print/lprng/files/lprng-init')
-rw-r--r--net-print/lprng/files/lprng-init38
1 files changed, 38 insertions, 0 deletions
diff --git a/net-print/lprng/files/lprng-init b/net-print/lprng/files/lprng-init
new file mode 100644
index 000000000000..115c8adf3ed7
--- /dev/null
+++ b/net-print/lprng/files/lprng-init
@@ -0,0 +1,38 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [ ! -e /etc/lprng/lpd.conf ] ; then
+ eerror "You need an /etc/lprng/lpd.conf file first"
+ eerror "There is a sample in /usr/share/doc/LPRng"
+ return 1
+ fi
+ if [ ! -e /etc/lprng/printcap ] ; then
+ eerror "You need an /etc/lprng/printcap file first"
+ eerror "There is a sample in /usr/share/doc/LPRng"
+ return 1
+ fi
+ if [ ! -e /etc/lprng/lpd.perms ] ; then
+ eerror "You need an /etc/lprng/lpd.perms file first"
+ eerror "There is a sample in /usr/share/doc/LPRng"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting lpd"
+ start-stop-daemon --start --pidfile "/var/run/lpd.515" --quiet --exec /usr/sbin/lpd
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping lpd"
+ start-stop-daemon --stop --pidfile "/var/run/lpd.515" --quiet --exec /usr/sbin/lpd
+ eend $?
+}