5 if [ "$BASEPATH" == "" ]
7 printf "Usage: $0 <path>\n"
11 if [ ! -d "$BASEPATH" ]
13 printf "Path '$BASEPATH' does not exist or not a directory.\n"
17 STGPATH="$BASEPATH/stg/projects/stargazer"
19 cp "stuff/stargazer-files.conf" "$STGPATH/stargazer.conf"
20 cp "stuff/rules" "$STGPATH/"
21 cp "stuff/OnConnect" "$STGPATH/"
22 cp "stuff/OnDisconnect" "$STGPATH/"
23 cp "stuff/OnChange" "$STGPATH/"
24 cp -R "stuff/db-stub" "$STGPATH/db"
27 groups | grep root > /dev/null 2> /dev/null
30 groups | grep wheel > /dev/null 2> /dev/null
33 printf "Can't find neither 'root' nor 'wheel' group.\n"
39 sed -i "" "s|-STG-PATH-|$STGPATH|g" "$STGPATH/stargazer.conf"
40 sed -i "" "s|-STG-GROUP-|$GROUP|g" "$STGPATH/stargazer.conf"
43 LOGFILE="$CURPATH/"`date "+%Y-%m-%d-%H%M%S.console.log"`
47 printf "Starting Stargazer... "
49 "$STGPATH/stargazer" "$STGPATH" >> "$LOGFILE" 2>&1 &
54 grep "Stg started successfully" "$STGPATH/stargazer.log" > /dev/null 2> /dev/null
60 if [ "$COUNT" == "....." ]
62 printf "Failed to start stg in 5 sec.\n"
68 PID=`cat "$STGPATH/stargazer.pid"`
69 printf "Started with pid $PID\n"
71 printf "\nTesting admins:\n"
72 "$CURPATH/test_admins.sh" "$BASEPATH"
73 printf "\nTesting services:\n"
74 "$CURPATH/test_services.sh" "$BASEPATH"
83 grep "Stg stopped successfully" "$STGPATH/stargazer.log" > /dev/null 2> /dev/null
89 if [ "$COUNT" == "....." ]
91 printf "Failed to stop stg in 5 sec.\n"