mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-28 10:02:43 +01:00
35 lines
695 B
Bash
35 lines
695 B
Bash
#!/bin/sh
|
|
#
|
|
# HAProxy daemon control script.
|
|
#
|
|
# This is an init script for the haproxy daemon.
|
|
# To use haproxy, you must first set up the config file(s).
|
|
#
|
|
# Written for Slackware Linux by Cherife Li <cherife@dotimes.com>.
|
|
#
|
|
|
|
Bin=/usr/sbin/haproxy
|
|
CfgFile=/etc/haproxy/haproxy.cfg
|
|
PIDFile=/var/run/haproxy.pid
|
|
|
|
case "$1" in
|
|
check)
|
|
echo "Checking HAProxy configuration file..."
|
|
$Bin -f $CfgFile -cV
|
|
;;
|
|
start)
|
|
echo "Starting HAProxy..."
|
|
$Bin -f $CfgFile -D -p $PIDFile
|
|
;;
|
|
stop)
|
|
echo "Shutting down HAProxy..."
|
|
kill -TERM `cat $PIDFile`
|
|
rm -f $PIDFile
|
|
;;
|
|
restart)
|
|
stop
|
|
start
|
|
;;
|
|
*)
|
|
echo "usage $0 {check|start|stop|restart}"
|
|
esac
|