mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-24 10:02:29 +01:00
31 lines
592 B
Bash
31 lines
592 B
Bash
#!/bin/sh
|
|
#
|
|
# HAProxy daemon control script.
|
|
# Written for Slackware Linux by Cherife Li <cherife-#-dotimes.com>.
|
|
|
|
BIN=/usr/sbin/haproxy
|
|
CONF=/etc/haproxy/haproxy.cfg
|
|
PID=/var/run/haproxy.pid
|
|
|
|
case "$1" in
|
|
check)
|
|
echo "Checking HAProxy configuration file..."
|
|
$BIN -f $CONF -cV
|
|
;;
|
|
start)
|
|
echo "Starting HAProxy..."
|
|
$BIN -f $CONF -D -p $PID
|
|
;;
|
|
stop)
|
|
echo "Shutting down HAProxy..."
|
|
kill -TERM `cat $PID`
|
|
rm -f $PID &> /dev/null
|
|
;;
|
|
restart)
|
|
stop
|
|
sleep 2
|
|
start
|
|
;;
|
|
*)
|
|
echo "usage `basename $0` {check|start|stop|restart}"
|
|
esac
|