/ Published in: Bash
Check if is root run this script.
Expand |
Embed | Plain Text
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 }
You need to login to post a comment.
