aboutsummaryrefslogtreecommitdiff
path: root/network/haproxy/rc.haproxy
diff options
context:
space:
mode:
Diffstat (limited to 'network/haproxy/rc.haproxy')
-rw-r--r--network/haproxy/rc.haproxy19
1 files changed, 17 insertions, 2 deletions
diff --git a/network/haproxy/rc.haproxy b/network/haproxy/rc.haproxy
index a95a407133931..e19ddf8ca5295 100644
--- a/network/haproxy/rc.haproxy
+++ b/network/haproxy/rc.haproxy
@@ -1,15 +1,30 @@
-#!/bin/sh
+#!/bin/bash
+#
+# Slackware initialization script for HAProxy.
+#
+# This script was made by T3slider.
+# Slight modifications by Badchay.
+#
+
HAPROXY=/usr/sbin/haproxy
CONFIG=/etc/haproxy/haproxy.cfg
PIDFILE=/var/run/haproxy.pid
+if [[ ! -f $CONFIG && "$1" == "start" ]]; then
+ echo "No configuration file found. Cannot continue."
+ echo "The script looks for the configuration file placed in $CONFIG"
+ exit 1
+fi
+
start() {
if [ -r $PIDFILE ]; then
echo 'HAProxy is already running!'
return
+ else
+ echo "Starting HAProxy..."
+ $HAPROXY -f $CONFIG -D -p $PIDFILE
fi
- $HAPROXY -f $CONFIG -D -p $PIDFILE
}
stop() {