update 33.1 50
This commit is contained in:
27
ctrl/stop.sh
Executable file
27
ctrl/stop.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
# Stop a running room by dispatching to its own ctrl/stop.sh in gen/.
|
||||
#
|
||||
# Usage:
|
||||
# ./ctrl/stop.sh # standalone
|
||||
# ./ctrl/stop.sh amar # a named room
|
||||
#
|
||||
# Mirror of ctrl/start.sh — the room's own script does the work.
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
ROOT_DIR="$(dirname "$SCRIPT_DIR")"
|
||||
|
||||
ROOM="standalone"
|
||||
if [[ $# -gt 0 && "$1" != -* ]]; then
|
||||
ROOM="$1"
|
||||
shift
|
||||
fi
|
||||
|
||||
ROOM_DIR="$ROOT_DIR/gen/$ROOM"
|
||||
|
||||
if [[ ! -x "$ROOM_DIR/ctrl/stop.sh" ]]; then
|
||||
echo "No stop script at gen/$ROOM/ctrl/stop.sh — nothing to stop." >&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
exec "$ROOM_DIR/ctrl/stop.sh" "$@"
|
||||
Reference in New Issue
Block a user