ref: code cleanup

This commit is contained in:
leukipp
2025-02-02 16:22:07 +01:00
parent cfbc391a52
commit bbe20fef8f
4 changed files with 49 additions and 20 deletions
+12 -3
View File
@@ -3,6 +3,7 @@
# Determine system architecture
echo -e "Determining system architecture..."
BITS=$(getconf LONG_BIT)
case "$(uname -m)" in
aarch64)
ARCH="arm64"
@@ -11,11 +12,17 @@ case "$(uname -m)" in
ARCH="x64"
;;
*)
echo "System architecture $(uname -m) not supported."
echo "Architecture $(uname -m) running $BITS-bit operating system is not supported."
exit 1
;;
esac
echo "System architecture $ARCH is supported."
if [ "$BITS" -ne 64 ]; then
echo "Architecture $ARCH running $BITS-bit operating system is not supported."
exit 1
fi
echo "Architecture $ARCH running $BITS-bit operating system is supported."
# Download the latest .deb package
echo -e "\nDownloading the latest release..."
@@ -23,7 +30,9 @@ echo -e "\nDownloading the latest release..."
DEB_URL=$(wget -qO- https://api.github.com/repos/leukipp/touchkio/releases/latest | \
grep -o "\"browser_download_url\": \"[^\"]*_${ARCH}\.deb\"" | \
sed 's/"browser_download_url": "//;s/"//g')
DEB_PATH="/tmp/$(basename "$DEB_URL")"
TMP_DIR=$(mktemp -d)
DEB_PATH="${TMP_DIR}/$(basename "$DEB_URL")"
if [ -z "$DEB_URL" ]; then
echo "Download url for .deb file not found."