make base-stack a requirement, update syntax of error messages to become proper sentences

This commit is contained in:
Matthew Saunders Brown 2024-07-24 14:59:14 -07:00
parent ebc32cae86
commit b10050cf16
2 changed files with 18 additions and 8 deletions

View File

@ -4,7 +4,7 @@ A set of bash scripts for installing and managing a WireGuard VPN server.
## Requirements
A minimal Debian 12 server install with no extra services or packages installed.
It is recommended to first install base-stack which will configure a basic server set up including firewald & fail2ban to secure the server:
Requires base-stack which will configure a basic server set up including firewald & fail2ban to secure the server:
https://git.stack-source.com/msb/base-stack
## Install

View File

@ -21,22 +21,32 @@ fi
os_id=`lsb_release -is 2>/dev/null`
os_release=`lsb_release -rs 2>/dev/null`
if [ $os_id != Debian ] || [ $os_release != 12 ]; then
echo "this installer only runs on Debian 12, bailing out"
echo "This installer only runs on Debian 12, bailing out."
exit 1
fi
if [ -d /etc/wiregaurd ]; then
echo "looks like wireguard is already installed, bailing out"
if [[ -d /etc/wiregaurd ]]; then
echo "Looks like wireguard is already installed, bailing out."
exit 1
fi
if [ -d /etc/stubby/ ]; then
echo "looks like stubby is already installed, bailing out"
if [[ -d /etc/stubby/ ]]; then
echo "Looks like stubby is already installed, bailing out."
exit 1
fi
if [ -d /etc/dnsmasq.d ]; then
echo "looks like dnsmasq is already installed, bailing out"
if [[ -d /etc/dnsmasq.d ]]; then
echo "Looks like dnsmasq is already installed, bailing out."
exit 1
fi
if [[ ! -d /etc/firewalld ]]; then
echo "Firewalld is not installed. Did you remember to install base-stack first?"
exit 1
fi
if [[ ! -d /etc/fail2ban ]]; then
echo "Fail2Ban is not installed. Did you remember to install base-stack first?"
exit 1
fi