Skip to content

Instantly share code, notes, and snippets.

@jstncno
Last active August 1, 2018 18:27
Show Gist options
  • Select an option

  • Save jstncno/0b18aff5a5cbe98edfe72931880e0f94 to your computer and use it in GitHub Desktop.

Select an option

Save jstncno/0b18aff5a5cbe98edfe72931880e0f94 to your computer and use it in GitHub Desktop.
Bash script that must run with sudo
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root (use sudo)" 1>&2
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment