2 # ______ _____ _ _ _____ _
3 # | ___ \ / ___| | | | |_ _| | |
4 # | |_/ / _ _______ _ __ ___ \ `--.| |__ __ _ _ __ __| | | | ___ ___ | |___
5 # | / | | |_ / _ \| '_ ` _ \ `--. \ '_ \ / _` | '__/ _` | | |/ _ \ / _ \| / __|
6 # | |\ \ |_| |/ / (_) | | | | | | /\__/ / | | | (_| | | | (_| | | | (_) | (_) | \__ \
7 # \_| \_\__, /___\___/|_| |_| |_| \____/|_| |_|\__,_|_| \__,_| \_/\___/ \___/|_|___/
11 # Ryzom - MMORPG Framework <https://ryzom.com/dev/>
12 # Copyright (C) 2019 Winch Gate Property Limited
13 # This program is free software: read https://ryzom.com/dev/copying.html for more details
15 # This script helps to manage the shard using a screen session.
16 # You can start, join, stop and get state of services
30 echo Screen sessions currently running
:
34 echo " 'start' to start the ${DOMAIN}"
35 echo " 'stop' to stop the ${DOMAIN}"
36 echo " 'join' to join the ${DOMAIN}'s screen session"
37 echo " 'share' to join the ${DOMAIN} in shared mode"
38 echo " 'state' to view state information for the ${DOMAIN}"
40 printf "Enter a command: "
44 if [ "$CMD" = "stop" ]
46 if [ $
(screen
-list |
grep \\\.
${DOMAIN} |
wc -l) != 1 ]
48 echo Cannot stop domain
\'${DOMAIN}\' because no screen by that name appears to be running
51 screen
-d -r $
(screen
-list |
grep \\\.
${DOMAIN}|
sed 's/(.*)//') -X quit
> /dev
/null
52 if [ -f $SHARD_PATH/run
/aes_state.txt
]
54 rm -r $SHARD_PATH/run
/*
60 if [ "$CMD" = "batchstart" ]
67 if [ "$CMD" = "light" ]
73 if [ "$CMD" = "start" ]
79 screen
-wipe > /dev
/null
81 if [ $
( screen
-list |
grep \\\.
${DOMAIN} |
wc -w ) != 0 ]
83 echo Cannot start domain
\'${DOMAIN}\' because this domain is already started
84 screen
-list |
grep $DOMAIN
86 echo "Starting shard screen from $(pwd) with SHARD_PATH=$SHARD_PATH"
87 export LD_LIBRARY_PATH
=$LD_LIBRARY_PATH:$SHARD_PATH/lib
88 export SHARD_PATH
=$SHARD_PATH
89 screen
$STARTARGS -S ${DOMAIN} -c $SHARD_PATH/tools/${DOMAIN}.screen${LIGHT}.rc
94 if [ "$CMD" = "share" ]
100 if [ "$CMD" = "join" ]
102 if [ $
(screen
-list |
grep \\\.
${DOMAIN} |
wc -l) != 1 ]
104 echo Cannot
join domain
\'${DOMAIN}\' because no screen by that name appears to be running
107 screen
-r ${JOINARGS} $
(screen
-list |
grep \\\.
${DOMAIN}|
sed 's/(.*)//')
111 if [ "$CMD" = "state" ]
114 echo State of domain
${DOMAIN}:
115 if [ $
(echo */*.state
) = "*/*.state" ]
117 echo - No state files found
119 grep RUNNING
*/*state