add arch check to script

This commit is contained in:
2023-10-20 21:12:33 -07:00
parent 40cdef4d84
commit 1010357f99
2 changed files with 70 additions and 26 deletions

View File

@@ -1,6 +1,28 @@
#!/usr/bin/env bash
set -e -o pipefail
curl -s https://artifacts.grlx.dev/latest/sprout > /usr/local/bin/grlx-sprout
arch=$(uname -m)
case $arch in
"x86_64")
machine_arch="x86_64"
;;
"i686"|"i386")
machine_arch="x86"
;;
"aarch64"|"arm64"|"armv8")
machine_arch="arm64"
;;
"armv7l")
machine_arch="arm"
;;
*)
echo "Unknown machine architecture: $arch"
exit 1
;;
esac
curl -s "https://artifacts.grlx.dev/${machine_arch}/latest/sprout" > /usr/local/bin/grlx-sprout
chmod +x /usr/local/bin/grlx-sprout
cat << EOF > /etc/systemd/system/grlx-sprout.service
@@ -31,9 +53,9 @@ if [ ! -f /etc/grlx/sprout ]; then
FARMER_PORT=5405
fi
cat << EOF > /etc/grlx/sprout
farmerinterface: $FARMER_INTERFACE
farmerurl: https://$FARMER_INTERFACE:$FARMER_PORT
EOF
farmerinterface: $FARMER_INTERFACE
farmerurl: https://$FARMER_INTERFACE:$FARMER_PORT
EOF
fi

View File

@@ -1,6 +1,28 @@
#!/usr/bin/env bash
set -e -o pipefail
curl -s https://artifacts.grlx.dev/v0.0.4/sprout > /usr/local/bin/grlx-sprout
arch=$(uname -m)
case $arch in
"x86_64")
machine_arch="x86_64"
;;
"i686"|"i386")
machine_arch="x86"
;;
"aarch64"|"arm64"|"armv8")
machine_arch="arm64"
;;
"armv7l")
machine_arch="arm"
;;
*)
echo "Unknown machine architecture: $arch"
exit 1
;;
esac
curl -s "https://artifacts.grlx.dev/${machine_arch}/v0.0.4/sprout" > /usr/local/bin/grlx-sprout
chmod +x /usr/local/bin/grlx-sprout
cat << EOF > /etc/systemd/system/grlx-sprout.service
@@ -31,9 +53,9 @@ if [ ! -f /etc/grlx/sprout ]; then
FARMER_PORT=5405
fi
cat << EOF > /etc/grlx/sprout
farmerinterface: $FARMER_INTERFACE
farmerurl: https://$FARMER_INTERFACE:$FARMER_PORT
EOF
farmerinterface: $FARMER_INTERFACE
farmerurl: https://$FARMER_INTERFACE:$FARMER_PORT
EOF
fi