This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ROOT_UID=0; # Only users with $UID 0 have root privileges | |
| E_NOTROOT=87; # Non-root exit error | |
| # Run as root | |
| if [ "$UID" -ne "$ROOT_UID" ]; then | |
| echo "Must be root to run this script." | |
| exit $E_NOTROOT; | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Read arguments | |
| # Author: Matthisk Heimensen | |
| NO_ARGS=0 | |
| E_OPTERROR=85 | |
| if [ $# -eq "$NO_ARGS" ]; then # Script invoked with no command-line args | |
| echo "Usage: `basename $0` options (-upfh)" | |
| exit $E_OPTERROR # Exit and explain usage |
NewerOlder