Skip to content
Snippets Groups Projects
Commit 0270a5b1 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Fixed user check in cron environment

parent 21e264ea
No related branches found
No related tags found
No related merge requests found
......@@ -107,7 +107,7 @@ class Tester:
log("USAGE: " + self.USAGE)
sys.exit(1)
else:
log("Optional target user : %s" % arg)
log("Optional target user: %s" % arg)
if not os.path.isdir(os.path.join("/home", arg)):
log("Mediaserver user %s does not exist" % arg)
sys.exit(1)
......@@ -123,7 +123,7 @@ class Tester:
sys.path.append(root_dir)
# Check that this script is run by root
debug = "-d" in args
if os.environ.get("USER") != "root" and not debug:
if os.getuid() != 0 and not debug:
log("This script should be run as root user.")
sys.exit(1)
# Update envsetup files
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment