diff --git a/squid-add-user.sh b/squid-add-user.sh index 714a84c..da6f002 100644 --- a/squid-add-user.sh +++ b/squid-add-user.sh @@ -10,6 +10,11 @@ # https://serverok.in/contact ############################################################ +if [ `whoami` != root ]; then + echo "ERROR: You need to run the script as user root or add sudo before command." + exit 1 +fi + if [ ! -f /usr/bin/htpasswd ]; then echo "htpasswd not found" exit 1 diff --git a/squid-uninstall.sh b/squid-uninstall.sh index 4ee0985..c221b63 100644 --- a/squid-uninstall.sh +++ b/squid-uninstall.sh @@ -10,6 +10,11 @@ # https://serverok.in/contact ############################################################ +if [ `whoami` != root ]; then + echo "ERROR: You need to run the script as user root or add sudo before command." + exit 1 +fi + if [ ! -f /usr/local/bin/sok-find-os ]; then echo "/usr/local/bin/sok-find-os not found" exit 1 diff --git a/squid3-install.sh b/squid3-install.sh index 4f77a8f..f6fc447 100644 --- a/squid3-install.sh +++ b/squid3-install.sh @@ -10,6 +10,10 @@ # https://serverok.in/contact ############################################################ +if [ `whoami` != root ]; then + echo "ERROR: You need to run the script as user root or add sudo before command." + exit 1 +fi /usr/bin/wget --no-check-certificate -O /usr/local/bin/sok-find-os https://raw.githubusercontent.com/serverok/squid-proxy-installer/master/sok-find-os.sh > /dev/null 2>&1 chmod 755 /usr/local/bin/sok-find-os