Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F4087338
D1133.id2897.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
981 B
Referenced Files
None
Subscribers
None
D1133.id2897.diff
View Options
diff --git a/nasqueron-operations/newuser b/nasqueron-operations/newuser
new file mode 100755
--- /dev/null
+++ b/nasqueron-operations/newuser
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+ARC=arc
+SHELLUSERS=pillar/users/shellusers.sls
+PROJECT=Eglide
+KEYS_TEMPLATE=P267
+
+[ -z "$EDITOR" ] && EDITOR=nano
+
+if [ $# -ne 1 ]
+then
+ >&2 echo "Usage: $(basename "$0") <username>"
+ exit 64
+fi
+ACCOUNT=$1
+
+if [ ! -f $SHELLUSERS ]
+then
+ >&2 echo "You must run this at the top of a rOPS working copy."
+ exit 66
+fi
+
+LASTUID=$(grep 'uid: 2' $SHELLUSERS | sort | tail -n 1 | awk '{print $2}')
+NEWUID=$((LASTUID + 1))
+{
+ echo " $ACCOUNT:"
+ echo " fullname: $ACCOUNT"
+ echo " uid: $NEWUID"
+} >> $SHELLUSERS
+
+AUTHORIZED_KEYS=roles/shellserver/users/files/ssh_keys/$ACCOUNT
+$EDITOR $SHELLUSERS
+$ARC paste $KEYS_TEMPLATE | sed "s/%%username%%/$ACCOUNT/g; s/%%project%%/$PROJECT/g" > "$AUTHORIZED_KEYS"
+$EDITOR "$AUTHORIZED_KEYS"
+$ARC feature "account/$ACCOUNT"
+git status
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 3, 14:49 (16 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2393154
Default Alt Text
D1133.id2897.diff (981 B)
Attached To
Mode
D1133: Add a script to create a new user on Eglide
Attached
Detach File
Event Timeline
Log In to Comment