projects
/
usertools.macosx.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eb5ed40
)
Make sure that the script is running with root privileges
author
Alexander Barton
<alex@barton.de>
Mon, 28 Sep 2009 10:17:14 +0000
(12:17 +0200)
committer
Alexander Barton
<alex@barton.de>
Mon, 28 Sep 2009 10:17:14 +0000
(12:17 +0200)
useradd.macosx.sh
patch
|
blob
|
history
diff --git
a/useradd.macosx.sh
b/useradd.macosx.sh
index 0bebb0c3c2a05c5ac5892d3aae8c5077fdc65fa6..5382ec02d84baf49073751a179f392b936e0971e 100755
(executable)
--- a/
useradd.macosx.sh
+++ b/
useradd.macosx.sh
@@
-111,6
+111,8
@@
done
[ -n "$home_dir" ] || home_dir="/Users/$user_name"
[ -n "$shell" ] || shell="/bin/bash"
+[ "$UID" -eq 0 ] || Abort "This script must be run as root!"
+
# Check that directory services are running
launchctl list 2>/dev/null | fgrep "com.apple.DirectoryServices" >/dev/null 2>&1
if [ $? -ne 0 ]; then
@@
-184,4
+186,4
@@
chmod 755 "$home_dir" || Abort
echo "User '$user_name' ($user_id) has been created."
exit 0
-# -eof-
\ No newline at end of file
+# -eof-