mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
fixed perm bug and tested
This commit is contained in:
parent
10f4d83bb4
commit
68b416f6d3
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user