4 #DOMAIN=$(pwd|sed s%/home/nevrax/%%)
10 echo Screen sessions currently running
:
14 echo " 'start' to start the shard"
15 echo " 'stop' to stop the ${DOMAIN}"
16 echo " 'join' to join the ${DOMAIN}'s screen session"
17 echo " 'share' to join the screen session in shared mode"
18 echo " 'state' to view state information for the ${DOMAIN}"
20 printf "Enter a command: "
24 if [ "$CMD" = "stop" ]
26 if [ $
(screen
-list |
grep \\\.
${DOMAIN} |
wc -l) != 1 ]
28 echo Cannot stop domain
\'${DOMAIN}\' because no screen by that name appears to be running
31 screen
-d -r $
(screen
-list |
grep \\\.
${DOMAIN}|
sed 's/(.*)//') -X quit
> /dev
/null
33 rm -v */*launch_ctrl .
/global.launch_ctrl
38 if [ "$CMD" = "batchstart" ]
44 if [ "$CMD" = "start" ]
47 screen
-wipe > /dev
/null
48 if [ $
( screen
-list |
grep \\\.
${DOMAIN} |
wc -w ) != 0 ]
50 echo Cannot start domain
\'${DOMAIN}\' because this domain is already started
51 screen
-list |
grep $DOMAIN
53 screen
$STARTARGS -S ${DOMAIN} -c ${DOMAIN}.screen.rc
56 if [ "$STARTARGS" != "" ]
58 # on "batchstart", AES needs to be launched and AES will then launch other services
59 printf LAUNCH
> aes
/aes.launch_ctrl
63 if [ "$CMD" = "join" ]
65 if [ $
(screen
-list |
grep \\\.
${DOMAIN} |
wc -l) != 1 ]
67 echo Cannot
join domain
\'${DOMAIN}\' because no screen by that name appears to be running
70 screen
-r $
(screen
-list |
grep \\\.
${DOMAIN}|
sed 's/(.*)//')
74 if [ "$CMD" = "share" ]
76 if [ $
(screen
-list |
grep \\\.
${DOMAIN} |
wc -l) != 1 ]
78 echo Cannot
join domain
\'${DOMAIN}\' because no screen by that name appears to be running
81 screen
-r -x $
(screen
-list |
grep \\\.
${DOMAIN}|
sed 's/(.*)//')
85 if [ "$CMD" = "state" ]
87 echo State of domain
${DOMAIN}:
88 if [ "$(echo */*.state)" = "*/*.state" ]
90 echo - No state files found