]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
added function cfe-config-adduser.
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Fri, 8 Nov 2013 14:06:05 +0000 (15:06 +0100)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Fri, 8 Nov 2013 14:06:05 +0000 (15:06 +0100)
init.el

diff --git a/init.el b/init.el
index 2eb16b5723082a58f4679dc609cd300fe17631f2..653fe21c851c8989919da2c0cae0ea8aeaa68834 100644 (file)
--- a/init.el
+++ b/init.el
@@ -159,6 +159,23 @@ load-path))
 (interactive) (find-file "~/.cfagent/inputs/config.cf")
 )
 
+;; cfe-config-adduser runs ldapsearch with cn=user to fill some values.
+
+(defun cfe-config-adduser ( user )
+"Insert usertemplate for config.cf"
+  (interactive "sUser: ")
+  (insert "      \"users[" user "][login]\" string => \"" user "\";
+      \"users[" user "][fullname]\" string => \"" (substring ( shell-command-to-string (concat "ldapse " user " givenName ")) 0 -1) " " (substring ( shell-command-to-string (concat "ldapse " user " sn ")) 0 -1) "\";
+      \"users[" user "][uid]\" string => \"" (substring ( shell-command-to-string (concat "ldapse " user " uidNumber")) 0 -1) "\";
+      \"users[" user "][gid]\" string => \"" (substring ( shell-command-to-string (concat "ldapse " user " uidNumber")) 0 -1)"\";
+      \"users[" user "][group]\" string => \"" user "\";
+      \"users[" user "][groups]\" slist => { \"adm\",\"apache\",\"games\" };
+      \"users[" user "][home]\" string => \"/home/" user "\";
+      \"users[" user "][shell]\" string => \"/bin/bash\";
+      \"users[" user "][flags]\" string => \"-m\";
+      \"users[" user "][authorized_keys][0]\" string => \"\";" )
+
+)
 ;;(defun scpload (&rest args)
 ;;"scp copy from pottwal"
 ;;   (shell-command ( scp andreas@pottwal: emacstmp/))