load-balancer / start.bash
Vadnir's picture
Create start.bash
a2dfbfa
Raw
History Blame Contribute Delete
500 Bytes
#!/bin/bash
#
# start.bash
#
HAPROXY="/etc/haproxy"
OVERRIDE="/haproxy-override"
PIDFILE="/var/run/haproxy.pid"
CONFIG="haproxy.cfg"
ERRORS="errors"
cd "$HAPROXY"
# Symlink errors directory
if [[ -d "$OVERRIDE/$ERRORS" ]]; then
mkdir -p "$OVERRIDE/$ERRORS"
rm -fr "$ERRORS"
ln -s "$OVERRIDE/$ERRORS" "$ERRORS"
fi
# Symlink config file.
if [[ -f "$OVERRIDE/$CONFIG" ]]; then
rm -f "$CONFIG"
ln -s "$OVERRIDE/$CONFIG" "$CONFIG"
fi
exec haproxy -f /etc/haproxy/haproxy.cfg -p "$PIDFILE"