From 1a30b126eff10967ddfdd6d55de73d3d59cc582a Mon Sep 17 00:00:00 2001 From: David Konsumer Date: Thu, 29 Dec 2022 01:25:33 -0800 Subject: [PATCH] better login script --- login.sh | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) mode change 100644 => 100755 login.sh diff --git a/login.sh b/login.sh old mode 100644 new mode 100755 index f6e2a83..6b64c2c --- a/login.sh +++ b/login.sh @@ -3,9 +3,34 @@ # this script will create login credentials for you # run with curl -L https://raw.githubusercontent.com/notnullgames/deckagog/login.sh | bash -curl -L https://github.com/notnullgames/goglogin/releases/download/0.0.0/linux-x86-64.zip > /tmp/linux-x86-64.zip +unamestr=$(uname) +if [ "$unamestr" == 'Linux' ]; then + platform='linux' +elif [ "$unamestr" == 'Darwin' ]; then + platform='mac' +else + echo "Unknown platform." + exit 1 +fi + +unamestr=$(uname -m) +if [ "${unamestr}" == "aarch64" ];then + arch='arm64' +elif [ "$unamestr" == 'arm64' ]; then + arch='arm64' +elif [ "$arch" == 'armv*' ]; then + arch='arm64' +elif [ "$unamestr" == 'x86_64' ]; then + arch='x86-64' +else + echo "Unknown arch." + exit 1 +fi + +curl -L "https://github.com/notnullgames/goglogin/releases/download/0.0.0/${platform}-${arch}.zip" > /tmp/goglogin.zip + cd /tmp -unzip linux-x86-64.zip +unzip goglogin.zip CODE=$(./goglogin) rm goglogin