updated on Thu Jan 19 12:17:07 UTC 2012
[aur-mirror.git] / smtpprox / smtpprox.sh
bloba21e5935bf9600c1e4fb8a45b0099125c9a6cc90
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PROGNAME=smtpprox
7 case "$1" in
8 start)
9 stat_busy "Starting Smtpprox"
10 su nobody -c "/opt/smtpprox/$PROGNAME --listen=127.0.0.1:10025 --talk=127.0.0.1:10026"
11 if [ $? -gt 0 ]; then
12 stat_fail
13 else
14 pidof -o %PPID -x smtpprox >/var/run/$PROGNAME.pid
15 add_daemon smtpprox
16 stat_done
19 stop)
20 stat_busy "Stopping Smtpprox"
21 if [ ! -e /var/run/$PROGNAME.pid ] ; then
22 echo "$PROGNAME not running"
23 else
24 kill `cat /var/run/$PROGNAME.pid`
25 if [ $? -gt 0 ]; then
26 stat_fail
27 else
28 rm_daemon smtpprox
29 stat_done
33 restart)
34 $0 stop
35 sleep 2
36 $0 start
38 esac