mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-26 22:06:35 +01:00
4902427f2d
Signed-off-by: bedlam <dave@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
44 lines
653 B
Bash
44 lines
653 B
Bash
#!/bin/sh
|
|
# Start/stop/restart opensmtpd
|
|
|
|
smtpd_start() {
|
|
if [ -x /usr/sbin/smtpd ]; then
|
|
echo "Starting OpenSMTPD: /usr/sbin/smtpd"
|
|
/usr/sbin/smtpd
|
|
fi
|
|
}
|
|
|
|
smtpd_stop() {
|
|
echo "Stopping OpenSMTPD"
|
|
/usr/bin/pkill -f /usr/sbin/smtpd
|
|
}
|
|
|
|
# Restart smtpd:
|
|
smtpd_restart() {
|
|
smtpd_stop
|
|
sleep 1
|
|
smtpd_start
|
|
}
|
|
|
|
# Test the smtpd configuration:
|
|
smtpd_testconf() {
|
|
echo "testing OpenSMTPD configuration: /usr/sbin/smtpd -n"
|
|
/usr/sbin/smtpd -n
|
|
}
|
|
|
|
case "$1" in
|
|
'start')
|
|
smtpd_start
|
|
;;
|
|
'stop')
|
|
smtpd_stop
|
|
;;
|
|
'restart')
|
|
smtpd_restart
|
|
;;
|
|
'testconf')
|
|
smtpd_testconf
|
|
;;
|
|
*)
|
|
echo "usage $0 start|stop|restart|testconf"
|
|
esac
|