4
# Required-Start: $syslog $network $remote_fs
5
# Required-Stop: $syslog $network $remote_fs
6
# Default-Start: 2 3 4 5
8
# Short-Description: Start the proxsmtp proxies
9
# Description: Start all the proxsmtp proxies from /etc/proxsmtp/*.conf
12
PATH=/sbin:/bin:/usr/sbin:/usr/bin
14
DAEMON=/usr/sbin/proxsmtpd
16
. /lib/lsb/init-functions
19
ls /etc/$NAME/*.conf 2>/dev/null
22
# Gracefully exit if the package has been removed.
23
test -x $DAEMON || exit 0
25
mkdir -p /var/run/proxsmtp
27
# Gracefully exit if there is no available config files
28
lsconfs > /dev/null || exit 0
31
start_daemon -p "$1" $DAEMON -p "$1" -f "$2"
35
killproc -p "$1" `basename $DAEMON`
41
log_daemon_msg "$1 smtp proxies"
42
lsconfs | while read conf; do
43
inst=`basename "$conf" .conf`
45
log_progress_msg "$inst"
46
$cmd "/var/run/$NAME/$inst.pid" "$conf"
53
d_all "Starting" d_start
56
d_all "Stopping" d_stop
59
d_all "Stopping" d_stop
60
d_all "Starting" d_start
63
echo "Usage: $0 {start|stop|restart|force-reload}" >&2