projects
/
mdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
52bcb17
)
Force init to be run as root
author
Frederic Massart
<fred@moodle.com>
Wed, 5 Dec 2012 06:33:43 +0000
(14:33 +0800)
committer
Frederic Massart
<fred@moodle.com>
Wed, 5 Dec 2012 06:33:43 +0000
(14:33 +0800)
moodle-init.py
patch
|
blob
|
history
diff --git
a/moodle-init.py
b/moodle-init.py
index
ed181d6
..
0b2b920
100755
(executable)
--- a/
moodle-init.py
+++ b/
moodle-init.py
@@
-44,6
+44,12
@@
parser = argparse.ArgumentParser(description='Initialise MDK for the current use
parser.add_argument('-f', '--force', action='store_true', help='Force the initialisation')
args = parser.parse_args()
+# Check root.
+if os.getuid() != 0:
+ debug('You must execute this as root.')
+ debug(' sudo mdk init')
+ sys.exit(1)
+
# Check what user we want to initialise for.
while True:
username = question('What user are you initialising MDK for?', os.getlogin())