rootaccess.sh
7 linesbash
DOWNLOAD
1#!/bin/bash
2# Aim: Program to perform root access check (Root Access Check).
3if [[ $(id -u) -eq 0 ]]; then
4    echo "This script cannot be run as root. Aborting..."
5    exit 1
6fi
7echo "This script can only be run by non-root user."