diff --git a/install/ersatztv-install.sh b/install/ersatztv-install.sh index 4f317baf..53a9c3ed 100644 --- a/install/ersatztv-install.sh +++ b/install/ersatztv-install.sh @@ -29,13 +29,10 @@ $STD apt-get install -y --no-install-recommends \ msg_ok "Installed Dependencies" -msg_info "Installing ErsatzTV (Patience)" -cd /opt -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) -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 -rm -R ErsatzTV-${RELEASE}-linux-x64.tar.gz +msg_info "Installing ErsatzTV " +RELEASE=$(curl -s https://api.github.com/repos/ErsatzTV/ErsatzTV/releases | grep -oP '"tag_name": "\K[^"]+' | head -n 1) +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 "Installed ErsatzTV" msg_info "Creating Service" @@ -45,6 +42,7 @@ Description=ErsatzTV Service After=multi-user.target [Service] +Type=simple User=root WorkingDirectory=/opt/ErsatzTV ExecStart=/opt/ErsatzTV/ErsatzTV @@ -54,7 +52,6 @@ RestartSec=30 [Install] WantedBy=multi-user.target EOF -sudo systemctl daemon-reload systemctl -q --now enable ersatzTV.service msg_ok "Created Service"