mirror of
https://github.com/serverok/squid-proxy-installer.git
synced 2026-04-02 02:28:30 +00:00
check if script is run as user root
This commit is contained in:
@@ -10,6 +10,11 @@
|
|||||||
# https://serverok.in/contact
|
# 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
|
if [ ! -f /usr/bin/htpasswd ]; then
|
||||||
echo "htpasswd not found"
|
echo "htpasswd not found"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -10,6 +10,11 @@
|
|||||||
# https://serverok.in/contact
|
# 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
|
if [ ! -f /usr/local/bin/sok-find-os ]; then
|
||||||
echo "/usr/local/bin/sok-find-os not found"
|
echo "/usr/local/bin/sok-find-os not found"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -10,6 +10,10 @@
|
|||||||
# https://serverok.in/contact
|
# 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
|
/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
|
chmod 755 /usr/local/bin/sok-find-os
|
||||||
|
|||||||
Reference in New Issue
Block a user