Skip to content

Commit

Permalink
Add script for Termux setup
Browse files Browse the repository at this point in the history
  • Loading branch information
RainbowUnicorn7297 committed Mar 9, 2024
1 parent ff866a5 commit 572ae09
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions standalone/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,15 @@ def reset_data():
help='game client language')
parser.add_argument('-r', '--reset', action='store_true',
help='reset data')
parser.add_argument('-c', '--config-only', action='store_true',
help='only update config; do not start server')
args = parser.parse_args()

config.is_local = True
if args.language:
config.language = args.language
if args.config_only:
exit()
start_server(args.reset)

try:
Expand Down
17 changes: 17 additions & 0 deletions standalone/setup-termux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/data/data/com.termux/files/usr/bin/bash

if [ ! -d ./mltd ]; then
mkdir mltd
pkg ins jq
fi
ARCHITECTURE=dpkg --print-architecture
URL=`curl -s 'https://api.github.com/repos/RainbowUnicorn7297/mltd-relive/releases?per_page=3' | jq -r '[.[] | select(.tag_name | startswith("standalone"))][0] | .assets[] | select(.name | contains("'"$ARCHITECTURE"'")).browser_download_url'`
curl "$URL" -o mltd/run -L
chmod +x mltd/run
if [ ! -f ./mltd/config.ini ]; then
LANGUAGE=
while [ "$LANGUAGE" != zh ] && [ "$LANGUAGE" != ko ]; do
read -p "Enter game client language: [zh/ko] " LANGUAGE
done
./mltd/run -c -l "$LANGUAGE"
fi

0 comments on commit 572ae09

Please sign in to comment.