aboutsummaryrefslogtreecommitdiff
path: root/network/opensmtpd/rc.opensmtpd
diff options
context:
space:
mode:
authorRobby Workman <rworkman@slackbuilds.org>2013-04-14 11:43:41 -0300
committerRobby Workman <rworkman@slackbuilds.org>2013-04-15 17:21:03 -0500
commit943df74e4857d1a481cea797a090abd56b4e35af (patch)
treed96613d5127618c17f24bd788e7abe4de359c6fb /network/opensmtpd/rc.opensmtpd
parent0c8689bc04b11e787370fb59ad318c20740d4f80 (diff)
network/opensmtpd: Added (Open SMTPd)
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'network/opensmtpd/rc.opensmtpd')
-rw-r--r--network/opensmtpd/rc.opensmtpd34
1 files changed, 34 insertions, 0 deletions
diff --git a/network/opensmtpd/rc.opensmtpd b/network/opensmtpd/rc.opensmtpd
new file mode 100644
index 0000000000000..fd4f9956f3930
--- /dev/null
+++ b/network/opensmtpd/rc.opensmtpd
@@ -0,0 +1,34 @@
+#!/bin/sh
+# Start/stop/restart opensmtpd
+
+smtpd_start() {
+ if [ -x /usr/sbin/smtpd ]; then
+ echo "Starting OpenSMTPD: /usr/sbin/smtpd"
+ smtpd # not using full path to work around a logging bug for now
+ fi
+}
+
+smtpd_stop() {
+ smtpctl stop
+}
+
+# Restart smtpd:
+smtpd_restart() {
+ smtpd_stop
+ sleep 1
+ smtpd_start
+}
+
+case "$1" in
+'start')
+ smtpd_start
+ ;;
+'stop')
+ smtpd_stop
+ ;;
+'restart')
+ smtpd_restart
+ ;;
+*)
+ echo "usage $0 start|stop|restart"
+esac