Check if script is running as root
This commit is contained in:
@@ -9,7 +9,11 @@ RED='\033[31m'
|
||||
NO_COLOR='\033[0m'
|
||||
|
||||
ZIP_FILENAME=pnetlabv6_offline.zip
|
||||
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/extras/upgrade_to_ubuntu_20.04/pnetlabv6_offline.zip
|
||||
# Check if user is root
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
echo -e "${RED}Upgrade has been rejected. You must run this script as root${NO_COLOR}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
lsb_release -r -s | grep -q 20.04
|
||||
if [ $? -ne 0 ]; then
|
||||
|
||||
Reference in New Issue
Block a user