2022-08-10 13:18:33 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
if [ $(id -u) -ne 0 ] ; then
|
|
|
|
|
echo "❌ Run me as root"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
DNF=$(which dnf)
|
|
|
|
|
APT=$(which apt)
|
|
|
|
|
|
|
|
|
|
if [ ! -z $DNF ] ; then
|
|
|
|
|
dnf install -y haproxy
|
|
|
|
|
elif [ ! -z $APT ] ; then
|
|
|
|
|
apt install -y haproxy
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
cp haproxy.cfg /etc/haproxy
|
2022-08-11 09:39:57 +00:00
|
|
|
sed -i "s/8080/80/" /etc/haproxy/haproxy.cfg
|
2022-08-11 09:50:12 +00:00
|
|
|
sed -i "s/mybunker/127.0.0.1/" /etc/haproxy/haproxy.cfg
|
2022-08-11 11:28:30 +00:00
|
|
|
systemctl stop bunkerweb
|
2022-08-10 13:18:33 +00:00
|
|
|
systemctl stop haproxy
|
|
|
|
|
systemctl start haproxy
|
|
|
|
|
|
|
|
|
|
echo "hello" > /opt/bunkerweb/www/index.html
|