xwords/xwords4/linux/scripts/opendevs.sh
Eric House 55e36e10a7 new script to run many games per device
I need it to be much closer to Android....
2023-11-27 21:32:43 -08:00

34 lines
638 B
Bash
Executable file

#!/bin/bash
set -u -e
FILES=""
ARGS=""
APP=./obj_linux_memdbg/xwords
usage() {
echo "usage: $0 [args...] file1.db [file2..n.db]"
echo "opens them with CrossWords, assuming they're dbs."
exit 0
}
while [ $# -gt 0 ]; do
if [ '--help' == $1 ]; then
usage
elif [ -f $1 ]; then
if file -L $1 | grep -q 'SQLite 3.x database'; then
FILES="${FILES} $1"
else
ARGS="${ARGS} $1"
fi
else
ARGS="${ARGS} $1"
fi
shift
done
for FILE in $FILES; do
LOGFILE="${FILE/.db/_log.txt}"
echo >> $LOGFILE
echo "******************** launch by $0 ********************" >> $LOGFILE
exec ${APP} ${ARGS} --db $FILE 2>>$LOGFILE &
done