From 0a0fe09e6f78c095a7ab4c0edc94e0aa0a4dc8e5 Mon Sep 17 00:00:00 2001 From: poikilos <7557867+poikilos@users.noreply.github.com> Date: Sun, 20 Nov 2022 18:57:00 -0500 Subject: [PATCH] Add lmk scripts. --- utilities/fix-lmk-permissions.sh | 4 ++++ utilities/get-lmk.sh | 22 ++++++++++++++++++++++ utilities/lmk-run | 13 +++++++++++++ 3 files changed, 39 insertions(+) create mode 100755 utilities/fix-lmk-permissions.sh create mode 100755 utilities/get-lmk.sh create mode 100755 utilities/lmk-run diff --git a/utilities/fix-lmk-permissions.sh b/utilities/fix-lmk-permissions.sh new file mode 100755 index 0000000..9938474 --- /dev/null +++ b/utilities/fix-lmk-permissions.sh @@ -0,0 +1,4 @@ +#!/bin/bash +cd /opt +sudo chown -R minebest:minebest linux-minetest-kit +sudo chmod -R g+w linux-minetest-kit diff --git a/utilities/get-lmk.sh b/utilities/get-lmk.sh new file mode 100755 index 0000000..c54c170 --- /dev/null +++ b/utilities/get-lmk.sh @@ -0,0 +1,22 @@ +#!/bin/bash +if [ -d "linux-minetest-kit" ]; then + >&2 echo "Error: linux-minetest-kit is already here. To update it safely, rename it, otherwise do:" + >&2 echo " rm -rf '`pwd`/linux-minetest-kit'" + exit 1 +fi +cd ~ +ZIP_NAME=linux-minetest-kit.zip +REMOTE_ZIP=mtio:/opt/minebest/assemble/prod/linux-minetest-kit.zip +rsync -tvP $REMOTE_ZIP . +code=$? +if [ $code -ne 0 ]; then + >&2 echo "Error: 'rsync -tvP $REMOTE_ZIP .' failed in \"`pwd`\". Make sure it was built on the other server or change $0 to match the correct location." + exit $code +fi +unzip $ZIP_NAME +code=$? +if [ $code -ne 0 ]; then + >&2 echo "Error: 'unzip $ZIP_NAME' failed in \"`pwd`\"." + exit $code +fi +exit 0 diff --git a/utilities/lmk-run b/utilities/lmk-run new file mode 100755 index 0000000..ca18988 --- /dev/null +++ b/utilities/lmk-run @@ -0,0 +1,13 @@ +#!/bin/sh +if [ "x$1" != "x" ]; then + LMK_MODE="$1" +fi +if [ "x$LMK_MODE" = "x" ]; then + echo "Error: (or LMK_MODE in environment). It should be classic, finetest, or trolltest." + exit 1 +fi +if [ ! -d "linux-minetest-kit" ]; then + echo "Error: linux-minetest-kit is not a directory in `pwd`. Run get-lmk.sh first." + exit 1 +fi +sudo -u minebest perl mtcompile-program.pl build --$LMK_MODE --server