diff options
author | Tor Andersson <tor@ccxvii.net> | 2025-04-25 12:18:00 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2025-04-25 17:56:43 +0200 |
commit | fc3501382c2aa3ef5b692f4f55c2616f9cade3f5 (patch) | |
tree | a047bb94f8f1854c621fa0fba5ed62c8e0d0be14 /bin/rtt | |
parent | ed2361980b455d1825d811670f329cbcf5624927 (diff) | |
download | server-fc3501382c2aa3ef5b692f4f55c2616f9cade3f5.tar.gz |
Move toolbox scripts to a "bin" directory.
Add a super "rtt" command to run the scripts.
Diffstat (limited to 'bin/rtt')
-rwxr-xr-x | bin/rtt | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -0,0 +1,31 @@ +#!/bin/bash + +cmd=$1 +shift + +bindir=$(dirname $(readlink -f $0)) + +if [ ! -n "$cmd" ] +then + cmd=help +fi + +if [ ! -f ./server.js ] +then + echo "rtt: command must run in the top-level server directory!" + exit 1 +fi + +if [ ! -f $bindir/rtt-$cmd ] +then + echo "rtt: '$cmd' is not an rtt command" + exit 1 +fi + +if [ ! -f ./db -a "$cmd" != init -a "$cmd" != "help" ] +then + echo "rtt: the database does not exist!" + exit 1 +fi + +exec $bindir/rtt-$cmd "$@" |