From 68b416f6d3b7e25a294d2ad113febc2f3d638e19 Mon Sep 17 00:00:00 2001 From: Karim <37943746+ksaadDE@users.noreply.github.com> Date: Thu, 10 Oct 2024 21:56:03 +0200 Subject: [PATCH] fixed perm bug and tested --- update_spotube_on_linux.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/update_spotube_on_linux.sh b/update_spotube_on_linux.sh index c9fa2136..1c82fd46 100644 --- a/update_spotube_on_linux.sh +++ b/update_spotube_on_linux.sh @@ -10,7 +10,7 @@ symlinkpath="/usr/bin/spotube" p="/usr/share/spotube-bin" # Path where the tar.xz should be downloaded and unpacked tmpf="$p/test.tar.xz" # temporary .tar.xz name and location (within Path p) repo="krtirtho/spotube" # define repo path -arch="aarch64" # arch? either aarch64 or x86_64 +arch="x86_64" # arch? either aarch64 or x86_64 url="https://api.github.com/repos/$repo/releases/latest" u="root" # who is the owner of /usr/share/spotube-bin/ @@ -28,7 +28,7 @@ fi a=$(curl -s "$url" | sed 's/[()",{}]/ /g; s/ /\n/g' | grep "https.*releases/download.*tar.xz" | grep "$arch") # select the correct binary from Github release path via JSON API if [ -z "$a" ]; then echo "[ERROR]: UPDATE FAILED: Url '$url' is invalid, exiting." - exit; + exit fi # rm "$p/*" -r # optionally remove everything in the folder before (avoiding left overs and other issues) @@ -59,8 +59,8 @@ echo "[+] unpacking completed" # when updated rm "$tmpf" -chmod 0400 "$p/lastupdate.txt" echo "$(date -I'seconds')|$a" >> "$p/lastupdate.txt" # add datetime and tar.xz link entry to lastupdate.txt +chmod 0400 "$p/lastupdate.txt" echo "[+] UPDATE LOOKS SUCCESSFUL. CHECK BY RUNNING $p/spotube" echo "[+] updated symlink of /usr/bin/spotube to '$p'/spotube " -ln -sfn "$p/spotube" "$symlinkpath" # force update or creation of symlink +ln -sfn "$p/spotube" "$symlinkpath"