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 printf "Starting Stargazer... "
35 "$STGPATH/stargazer" "$STGPATH" >> "$LOGFILE" 2>&1 &
40 grep "Stg started successfully" "$STGPATH/stargazer.log" > /dev/null 2> /dev/null
46 if [ "$COUNT" == "....." ]
48 printf "Failed to start stg in 5 sec.\n"
54 PID=`cat "$STGPATH/stargazer.pid"`
55 printf "Started with pid $PID\n"
57 printf "\nTesting admins:\n"
58 "$CURPATH/test_admins.sh" "$BASEPATH"
59 printf "\nTesting services:\n"
60 "$CURPATH/test_services.sh" "$BASEPATH"
69 grep "Stg stopped successfully" "$STGPATH/stargazer.log" > /dev/null 2> /dev/null
75 if [ "$COUNT" == "....." ]
77 printf "Failed to stop stg in 5 sec.\n"