diff options
author | Expo on server <expo@expo.survex.com> | 2020-05-26 00:47:01 +0100 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2020-05-26 02:25:30 +0100 |
commit | 227120fd57c9fe3287a2feccd9eb4e30cc40909f (patch) | |
tree | 864c1b4f3148964e033e3e785c00a11d55be94a9 | |
parent | 8b74ff4bb60096b1d252aeb90ba6779e305ce788 (diff) | |
download | troggle-227120fd57c9fe3287a2feccd9eb4e30cc40909f.tar.gz troggle-227120fd57c9fe3287a2feccd9eb4e30cc40909f.tar.bz2 troggle-227120fd57c9fe3287a2feccd9eb4e30cc40909f.zip |
Add check to avoid running databaseReset as root accidentally
-rw-r--r-- | databaseReset.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/databaseReset.py b/databaseReset.py index 81a3ad5..bfed32a 100644 --- a/databaseReset.py +++ b/databaseReset.py @@ -6,6 +6,10 @@ import timeit import json import settings +if os.geteuid() == 0: + print("This script should be run as expo not root - quitting") + exit() + os.environ['PYTHONPATH'] = settings.PYTHON_PATH os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings') |