From 1f621333de158c921f860d55193e38fe261e47ea Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Thu, 22 Apr 2021 01:29:52 +0000 Subject: [PATCH] Add run script --- download_mcdata.sh | 11 ----------- run_linux.sh | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 11 deletions(-) delete mode 100755 download_mcdata.sh create mode 100755 run_linux.sh diff --git a/download_mcdata.sh b/download_mcdata.sh deleted file mode 100755 index 20cb0af..0000000 --- a/download_mcdata.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -set -eu - -VERSION="1.16.4" - -wget -Omcdata.zip "https://apimon.de/mcdata/$VERSION/$VERSION.zip" -rm -r minecraft_data || true -mkdir minecraft_data -unzip mcdata.zip -d minecraft_data -rm mcdata.zip diff --git a/run_linux.sh b/run_linux.sh new file mode 100755 index 0000000..d846c1f --- /dev/null +++ b/run_linux.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +set -eu + +# download minecraft data + +if [ ! -d "minecraft_data" ] +then + echo "Grabbing minecraft data..." + sleep 2 + + VERSION="1.16.4" + + wget -Omcdata.zip "https://apimon.de/mcdata/$VERSION/$VERSION.zip" + mkdir minecraft_data + unzip mcdata.zip -d minecraft_data + rm mcdata.zip +fi + +# create virtual environment + +if [ ! -d "env" ] +then + echo "Installing Python requirements..." + sleep 2 + + virtualenv -p python3 env + source env/bin/activate + pip install -r requirements.txt +else + source env/bin/activate +fi + +echo "Running bot..." + +python main.py