How to check the superuser privileges

/ Published in: Bash
Save to your folder(s)

Copy this code and paste it in your HTML
  1. if [ $UID -ne 0 ]; then
  2. echo "Superuser privileges are required to run this script."
  3. echo "e.g. \"sudo $0\""
  4. exit 1
  5. fi

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.