Advertisement
metalx1000

Check if user is root

Apr 5th, 2016
707
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.14 KB | None | 0 0
  1. #check if root user
  2. if [[ $EUID -ne 0 ]]; then
  3. echo "You must be a root user"
  4. echo "Trying to restart script as sudo"
  5. sudo $0
  6. exit
  7. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement