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"
26 sed -i "s|-STG-PATH-|$STGPATH|g" "$STGPATH/stargazer.conf"
29 LOGFILE="$CURPATH/"`date "+%Y-%m-%d-%H%M%S.console.log"`
33 "$STGPATH/stargazer" "$STGPATH" >> "$LOGFILE" 2>&1 &
38 grep "Stg started successfully" "$STGPATH/stargazer.log" > /dev/null 2> /dev/null
44 if [ "$COUNT" == "....." ]
46 printf "Failed to start stg in 5 sec.\n"
52 PID=`cat "$STGPATH/stargazer.pid"`
53 printf "Started with pid $PID\n"
55 "$CURPATH/test_admins.sh" "$BASEPATH"
56 "$CURPATH/test_services.sh" "$BASEPATH"
58 printf "Stopping...\n"
64 grep "Stg stopped successfully" "$STGPATH/stargazer.log" > /dev/null 2> /dev/null
70 if [ "$COUNT" == "....." ]
72 printf "Failed to stop stg in 5 sec.\n"