/ Published in: Bash
![](/img/icon_sav.png?v3)
If you have a script that must be run as the root user, put this at the top:
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/bin/bash # Test if user is root if [ $UID -ne 0 ]; then echo "ERROR: $0 must be run as root" exit 1 fi
Comments
![RSS Feed for Comments RSS Icon](/images/rss.png?v3)