2022-08-09 02:54:49 +00:00
|
|
|
IMAGE=haproxy:latest
|
2023-02-22 16:49:54 +00:00
|
|
|
# Get DataDir location
|
|
|
|
DATA_DIR="/data"
|
|
|
|
case "$(ubnt-device-info firmware || true)" in
|
|
|
|
1*)
|
|
|
|
DATA_DIR="/mnt/data"
|
|
|
|
;;
|
|
|
|
2*)
|
|
|
|
DATA_DIR="/data"
|
|
|
|
;;
|
|
|
|
3*)
|
|
|
|
DATA_DIR="/data"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "ERROR: No persistent storage found." 1>&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
2022-08-09 02:54:49 +00:00
|
|
|
|
|
|
|
podman pull $IMAGE
|
2021-10-09 01:30:21 +00:00
|
|
|
podman stop haproxy
|
|
|
|
podman rm haproxy
|
|
|
|
podman run -d --net=host --restart always \
|
|
|
|
--name haproxy \
|
|
|
|
--hostname ha.proxy \
|
2023-02-22 16:49:54 +00:00
|
|
|
-v "${DATA_DIR}/haproxy/:/usr/local/etc/haproxy/" \
|
2022-08-09 02:54:49 +00:00
|
|
|
$IMAGE
|