Update ersatztv.sh

Finalize Update Script
This commit is contained in:
CanbiZ 2024-04-29 15:28:20 +02:00 committed by GitHub
parent 38be75aa53
commit 884109f6c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -66,15 +66,14 @@ systemctl stop ersatzTV
msg_ok "Stopped ErsatzTV"
msg_info "Updating ErsatzTV"
RELEASE=$(curl -s https://api.github.com/repos/ErsatzTV/ErsatzTV/releases | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }' | head -n 1)
RELEASE=$(curl -s https://api.github.com/repos/ErsatzTV/ErsatzTV/releases | grep -oP '"tag_name": "\K[^"]+' | head -n 1)
cd /opt
if [ -d ErsatzTV_bak ]; then
rm -rf ErsatzTV_bak
fi
mv ErsatzTV ErsatzTV_bak
wget -q https://github.com/ErsatzTV/ErsatzTV/releases/download/${RELEASE}/ErsatzTV-${RELEASE}-linux-x64.tar.gz
tar -xf ErsatzTV-${RELEASE}-linux-x64.tar.gz
mv ErsatzTV-${RELEASE}-linux-x64 ErsatzTV
wget -qO- "https://github.com/ErsatzTV/ErsatzTV/releases/download/${RELEASE}/ErsatzTV-${RELEASE}-linux-x64.tar.gz" | tar -xz -C /opt
mv "/opt/ErsatzTV-${RELEASE}-linux-x64" /opt/ErsatzTV
msg_ok "Updated ErsatzTV"
msg_info "Starting ErsatzTV"