mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-18 22:06:04 +01:00
1926c11d59
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
35 lines
506 B
Bash
35 lines
506 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/sbin/smtpctl stop 1>/dev/null 2>/dev/null || /usr/bin/pkill smtpd
|
|
}
|
|
|
|
# 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
|