Who Is Running The Script

#!/bin/bash
 
# Description: Who is running this script.
# Author: Xuan Ngo
#############################################
 
# Who Is Running The Script.
WHOAMI=`/usr/bin/whoami`
echo "$WHOAMI is running this script!"
 
if [ $WHOAMI != "root" ]; then
    echo
    echo "You must be root to run this!"
    echo
    exit 1
fi