23 lines
446 B
Bash
Executable File
23 lines
446 B
Bash
Executable File
#!/bin/ash
|
|
set -e
|
|
|
|
if ! grep -qE '^haproxy:x:'"${UID}"':haproxy$' /etc/group ; then
|
|
addgroup -g "${GID}" haproxy
|
|
fi
|
|
|
|
if ! grep -qE '^haproxy:x:'"${UID}"':'"${GID}"':.*$' /etc/passwd ; then
|
|
adduser -D -u "${UID}" -G haproxy haproxy
|
|
fi
|
|
|
|
mkdir -vp \
|
|
/etc/haproxy \
|
|
/var/run/haproxy
|
|
|
|
chmod 700 /etc/haproxy
|
|
|
|
chown haproxy:haproxy \
|
|
/etc/haproxy \
|
|
/var/run/haproxy
|
|
|
|
su haproxy -c '/haproxy -f /etc/haproxy/haproxy.cfg'
|