1
0
Fork 0
habalancer/setup/balancer.sh
2025-03-27 16:14:51 +01:00

39 lines
No EOL
679 B
Bash

#!/bin/bash
# Author: Martijn de Boer
if [[ $EUID -ne 0 ]]; then
echo "You must be a root user" 2>&1
exit 1
fi
if [[ ! -f /etc/debian_version ]]; then
echo "This script only works on Debian"
exit 1
fi
apt update && apt upgrade -y && apt install -y \
caddy \
wireguard \
jq \
openssh-server \
ufw
ufw default deny incoming
ufw default allow outgoing
ufw allow http
ufw allow https
ufw enable
mkdir -p /root/tunnel-manager /etc/tunnel-manager/domains.d
read -p "Reboot the system now? " -n 1 -r REPLY_REBOOT
case "$REPLY_REBOOT" in
y|Y ) echo "yes";;
n|N ) echo "no";;
* ) echo "invalid";;
esac
if [[ $REPLY_REBOOT =~ ^[Yy]$ ]]
then
reboot
fi