From: Maxim Mamontov <faust.madf@gmail.com>
Date: Sat, 25 Oct 2014 01:54:36 +0000 (+0300)
Subject: Fill in template group.
X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/014356a786e82ad8da85a8cf0dba6b1035794436?ds=inline;hp=4fe29c0b67d4408bcf631e3463eafbffca103a3f

Fill in template group.
---

diff --git a/functest/test.sh b/functest/test.sh
index 333c45e0..921fa3f2 100755
--- a/functest/test.sh
+++ b/functest/test.sh
@@ -23,7 +23,21 @@ cp "stuff/OnDisconnect" "$STGPATH/"
 cp "stuff/OnChange" "$STGPATH/"
 cp -R "stuff/db-stub" "$STGPATH/db"
 
-sed -i "s|-STG-PATH-|$STGPATH|g" "$STGPATH/stargazer.conf"
+GROUP=root
+groups | grep root > /dev/null 2> /dev/null
+if [ "$?" != "0" ]
+then
+    groups | grep wheel > /dev/null 2> /dev/null
+    if [ "$?" != "0" ]
+    then
+        printf "Can't find neither 'root' nor 'wheel' group.\n"
+        exit -1
+    fi
+    GROUP=wheel
+fi
+
+sed -i "" "s|-STG-PATH-|$STGPATH|g" "$STGPATH/stargazer.conf"
+sed -i "" "s|-STG-GROUP-|$GROUP|g" "$STGPATH/stargazer.conf"
 
 CURPATH=`pwd`
 LOGFILE="$CURPATH/"`date "+%Y-%m-%d-%H%M%S.console.log"`