summaryrefslogtreecommitdiffstats
path: root/network/dbmail/rc.dbmail-pop3d.new
diff options
context:
space:
mode:
author Sergei Fedosoff <eleksir@gmail.com>2018-05-25 22:14:25 +0700
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2018-05-25 22:14:41 +0700
commit0499dcf219f636ad9f81cf8ba79f2b2584f77693 (patch)
treeef1109ae5e59a940cbad46e10019a59fbd3ea7b9 /network/dbmail/rc.dbmail-pop3d.new
parentc17f1628cc9894fdd554dfbd46888f05f3c76c5e (diff)
downloadslackbuilds-0499dcf219f636ad9f81cf8ba79f2b2584f77693.tar.gz
slackbuilds-0499dcf219f636ad9f81cf8ba79f2b2584f77693.tar.xz
network/dbmail: Added (IMAP and POP3 Server).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/dbmail/rc.dbmail-pop3d.new')
-rw-r--r--network/dbmail/rc.dbmail-pop3d.new54
1 files changed, 54 insertions, 0 deletions
diff --git a/network/dbmail/rc.dbmail-pop3d.new b/network/dbmail/rc.dbmail-pop3d.new
new file mode 100644
index 0000000000..6398c40c8f
--- /dev/null
+++ b/network/dbmail/rc.dbmail-pop3d.new
@@ -0,0 +1,54 @@
+#!/bin/sh
+#
+# DBMail-pop3d startup script for Slackware Linux
+
+SERVICE='/usr/sbin/dbmail-pop3d'
+OPTS=''
+PIDDIR='/var/run/dbmail'
+PID="${PIDDIR}/dbmail-pop3d.pid"
+USER='mail'
+GROUP='mail'
+
+service_start() {
+ if [ ! -d "$PIDDIR" ]; then
+ mkdir "$PIDDIR"
+ chown ${USER}:${GROUP} "$PIDDIR"
+ fi
+
+ if [ -f "$PID" ]; then
+ echo "PID-file exist, refusing to run ${SERVICE}."
+ exit 1
+ fi
+
+ $SERVICE "$OPTS"
+}
+
+service_stop() {
+ if [ -f "$PID" ]; then
+ kill $(< $PID)
+ else
+ echo "No PID-file at $PID found, quitting."
+ exit 1
+ fi
+}
+
+service_restart() {
+ service_stop
+ sleep 1
+ service_start
+}
+
+case "$1" in
+ start)
+ service_start
+ ;;
+ stop)
+ service_stop
+ ;;
+ restart)
+ service_restart
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+esac