From 9fb650f7316b41373cfea425296a267b1b190acf Mon Sep 17 00:00:00 2001 From: Brendan McDevitt Date: Fri, 11 Feb 2022 20:11:24 -0600 Subject: [PATCH] guard clause to run bootstrap as root --- README.md | 2 +- bin/bootstrap.sh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ea2706e..9c23c7b 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Create a text file with one ip address per line and place it in the `./proxy_cen ### Step 2: Run bootstrap.sh -`./bootstrap.sh` +`bash bootstrap.sh` This will do the following: - Install squid proxy - Create a new ifcfg-eth0:{index} for every ip address in ./ips.txt diff --git a/bin/bootstrap.sh b/bin/bootstrap.sh index f614794..f1ff761 100755 --- a/bin/bootstrap.sh +++ b/bin/bootstrap.sh @@ -4,6 +4,11 @@ # 2. install a squid proxy with basic auth username/pass # 3. append ip addresses as listeners for each ip added. +if [ "$EUID" -ne 0 ] + then echo "Please run as root" + exit +fi + # step 1: install squid sh install_squid.sh