From ad1f06319887951eef4ea87be978e175b1dc948a Mon Sep 17 00:00:00 2001 From: Toastie Date: Tue, 25 Jun 2024 21:06:25 +1200 Subject: [PATCH] Updated e-arn to be e-are and added contents --- e-are.sh | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ e-arn.sh | 1 - 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 e-are.sh delete mode 100644 e-arn.sh diff --git a/e-are.sh b/e-are.sh new file mode 100644 index 0000000..1a72495 --- /dev/null +++ b/e-are.sh @@ -0,0 +1,77 @@ +#!/bin/sh +echo "Running EllieBot" +root=$(pwd) + +choice=4 + clear + +if hash dotnet 2>/dev/null +then + echo "Dotnet is installed." + echo "" +else + echo "Dotnet is not installed. Please install preqrequisites (option 1)." + exit 1 +fi + + echo "1. Run Auto Restart and update EllieBot." + echo "2. Run Auto Restart normally without updating EllieBot." + echo "3. Exit" + echo "" + echo "Choose:" + echo "[1] to Run with Auto Updating on restart after using \"die\" command." + echo "[2] to Run EllieBot with Auto Restart on \"die\" command without updating." + +while [ $choice -eq 4 ]; do +read choice + if [ $choice -eq 1 ] ; then + echo "" + echo "Running EllieBot with auto update. Please wait. . ." + while :; do + yt-dlp -U 2>/dev/null + cd "$root/elliebot" + git fetch + HEADHASH=$(git rev-parse HEAD) + UPSTREAMHASH=$(git rev-parse @{u}) + + if [[ "$HEADHASH" != "$UPSTREAMHASH" ]]; then + echo "Update found, this may take a few minutes... " + cd $root + wget -N https://toastielab.dev/Emotions-stuff/ellie-bash-installer/raw/branch/v4/e-download.sh && bash "$root/e-download.sh" + cd elliebot/output + dotnet EllieBot.dll + else + echo "No updates found, starting the bot... " + cd output + dotnet EllieBot.dll + fi + done + elif [ $choice -eq 2 ] ; then + echo "" + echo "Running EllieBot without auto update. Please wait. . ." + while :; do cd "$root/elliebot/output" && dotnet EllieBot.dll && youtube-dl -U; sleep 5s; done + echo "Done" + elif [ "$choice" -eq 3 ] ; then + echo "" + echo "Exiting..." + cd "$root" + exit 0 + else + echo "Invalid choice" + sleep 3s + echo "" + clear + echo "1. Run Auto Restart and update EllieBot." + echo "2. Run Auto Restart normally without updating EllieBot." + echo "3. Exit" + echo "" + echo "Choose:" + echo "[1] to Run with Auto Updating on restart after using \"die\" command." + echo "[2] to Run EllieBot with Auto Restart on \"die\" command without updating." + choice=4 + fi +done + +cd "$root" +rm "$root/e-are.sh" +exit 0 diff --git a/e-arn.sh b/e-arn.sh deleted file mode 100644 index 96b4b06..0000000 --- a/e-arn.sh +++ /dev/null @@ -1 +0,0 @@ -#!/bin/sh \ No newline at end of file