diff options
Diffstat (limited to 'databaseReset.py')
-rw-r--r-- | databaseReset.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/databaseReset.py b/databaseReset.py index bfed32a..e775eb7 100644 --- a/databaseReset.py +++ b/databaseReset.py @@ -6,10 +6,6 @@ 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') @@ -27,6 +23,11 @@ import troggle.logbooksdump # NOTE databaseReset.py is *imported* by views_other.py as it is used in the control panel # presented there. +if os.geteuid() == 0: + # This protects the server from having the wrong file permissions written on logs and caches + print("This script should be run as expo not root - quitting") + exit() + expouser=settings.EXPOUSER expouserpass=settings.EXPOUSERPASS expouseremail=settings.EXPOUSER_EMAIL |