Linux multi-monitor fullscreen support
[ryzomcore.git] / ryzom / tools / scripts / linux / ryzom_domain_screen_wrapper.sh
blob4f2f14e25c3e6457bf38f514082125c68210828f
1 #!/bin/sh
3 CMD=$1
4 #DOMAIN=$(pwd|sed s%/home/nevrax/%%)
5 DOMAIN=shard
7 if [ "$CMD" = "" ]
8 then
9 echo
10 echo Screen sessions currently running:
11 screen -list
12 echo
13 echo "Commands:"
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}"
19 echo
20 printf "Enter a command: "
21 read CMD
24 if [ "$CMD" = "stop" ]
25 then
26 if [ $(screen -list | grep \\\.${DOMAIN} | wc -l) != 1 ]
27 then
28 echo Cannot stop domain \'${DOMAIN}\' because no screen by that name appears to be running
29 screen -list
30 else
31 screen -d -r $(screen -list | grep \\\.${DOMAIN}| sed 's/(.*)//') -X quit> /dev/null
32 rm -v */*.state
33 rm -v */*launch_ctrl ./global.launch_ctrl
37 STARTARGS=
38 if [ "$CMD" = "batchstart" ]
39 then
40 STARTARGS='-d -m'
41 CMD='start'
44 if [ "$CMD" = "start" ]
45 then
46 ulimit -c unlimited
47 screen -wipe > /dev/null
48 if [ $( screen -list | grep \\\.${DOMAIN} | wc -w ) != 0 ]
49 then
50 echo Cannot start domain \'${DOMAIN}\' because this domain is already started
51 screen -list | grep $DOMAIN
52 else
53 screen $STARTARGS -S ${DOMAIN} -c ${DOMAIN}.screen.rc
56 if [ "$STARTARGS" != "" ]
57 then
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" ]
64 then
65 if [ $(screen -list | grep \\\.${DOMAIN} | wc -l) != 1 ]
66 then
67 echo Cannot join domain \'${DOMAIN}\' because no screen by that name appears to be running
68 screen -list
69 else
70 screen -r $(screen -list | grep \\\.${DOMAIN}| sed 's/(.*)//')
74 if [ "$CMD" = "share" ]
75 then
76 if [ $(screen -list | grep \\\.${DOMAIN} | wc -l) != 1 ]
77 then
78 echo Cannot join domain \'${DOMAIN}\' because no screen by that name appears to be running
79 screen -list
80 else
81 screen -r -x $(screen -list | grep \\\.${DOMAIN}| sed 's/(.*)//')
85 if [ "$CMD" = "state" ]
86 then
87 echo State of domain ${DOMAIN}:
88 if [ "$(echo */*.state)" = "*/*.state" ]
89 then
90 echo - No state files found
91 else
92 grep RUNNING */*state