summaryrefslogtreecommitdiffstats
path: root/pwd.awk
diff options
context:
space:
mode:
authorAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2015-04-09 15:43:28 +0200
committerroot <root@plonk.spline.inf.fu-berlin.de>2015-04-09 15:43:52 +0200
commit8f22682d7e6bb5e79a46a6d2a528cb7e472cfab9 (patch)
tree82300662aaa1a60d04cc0d5d0c7d41c3826adeb7 /pwd.awk
downloadsync-master.tar.gz
sync-master.tar.bz2
sync-master.zip
Initial commitHEADmaster
Diffstat (limited to 'pwd.awk')
-rw-r--r--pwd.awk22
1 files changed, 22 insertions, 0 deletions
diff --git a/pwd.awk b/pwd.awk
new file mode 100644
index 0000000..d9ffc49
--- /dev/null
+++ b/pwd.awk
@@ -0,0 +1,22 @@
+BEGIN {
+ uid = ""
+ passwd = ""
+}
+
+/^uid: / { uid=$2 }
+/^userPassword: / { passwd=$2 }
+/^userPassword:: / {" base64 -d<<< \""$2"\""|getline passwd }
+
+/^dn:/ {
+ if (uid != "" && passwd != "") {
+ printf("%s %s\n",uid,passwd)
+ }
+ uid = ""
+ passwd = ""
+}
+
+END {
+ if (uid != "" && passwd != "") {
+ printf("%s %s\n",uid,passwd)
+ }
+}