]> git.stg.codes - stg.git/commitdiff
Parse admins list.
authorMaxim Mamontov <faust.madf@gmail.com>
Fri, 10 Oct 2014 19:15:22 +0000 (22:15 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Fri, 10 Oct 2014 19:15:22 +0000 (22:15 +0300)
functest/test.sh

index 62a8a5810946c8ec271eba695b17bfb7b8fe167e..de55a588b7ec22e940f9de62025e474c6ab94a2f 100755 (executable)
@@ -61,7 +61,27 @@ then
     exit 0
 fi
 
-printf "Got admins list:\n$RES\n"
+printf "Got admins list:\n"
+
+LOGINS=""
+OLDIFS=$IFS
+IFS=$(printf "\n")
+for LINE in $RES
+do
+    printf -- "$LINE\n"
+    LOGIN=`echo $LINE | grep login`
+    if [ "$?" == "0" ]
+    then
+        LOGINS="$LOGINS\n"`echo $LOGIN | cut -d: -f2 | sed -e 's/^ *//' -e 's/ *$//'`
+    fi
+done
+IFS=$OLDIFS
+
+printf "Logins:\n$LOGINS\n"
+
+NUM=`echo $LOGINS | wc -l`
+
+printf -- "--------\n$NUM\n\n"
 
 printf "Stopping...\n"
 kill $PID