/ Published in: Bash
Check if is root run this script.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
if_root() { _user=`id | awk -F')' '{print $1}' | awk -F'(' '{print $2}'` if [ "$_user" == "root" ]; then # is root return 0 else # not root return 1 fi }