Skip to content

Instantly share code, notes, and snippets.

@yzdann
Created September 2, 2019 10:43
Show Gist options
  • Save yzdann/735762847e001f7101cef97eec000cf1 to your computer and use it in GitHub Desktop.
Save yzdann/735762847e001f7101cef97eec000cf1 to your computer and use it in GitHub Desktop.
class RootAccessException(Exception):
"""
Prevent running with Root Privileges
"""
pass
if os.getuid() == 0:
raise RootAccessException("Shouldn't run this script with Root Privileges")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment