From 73637ba53d957b19e05eb16e5636d20374353dfe Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Wed, 27 May 2020 01:04:37 +0100 Subject: Clean install with python3 --- databaseReset.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'databaseReset.py') 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 -- cgit v1.2.3