mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-07-26 15:57:37 +00:00
25
ct/go2rtc.sh
25
ct/go2rtc.sh
@ -27,14 +27,23 @@ function update_script() {
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
msg_info "Updating $APP"
|
||||
systemctl stop go2rtc
|
||||
cd /opt/go2rtc
|
||||
rm go2rtc_linux_amd64
|
||||
curl -fsSL "https://github.com/AlexxIT/go2rtc/releases/latest/download/go2rtc_linux_amd64" -o $(basename "https://github.com/AlexxIT/go2rtc/releases/latest/download/go2rtc_linux_amd64")
|
||||
chmod +x go2rtc_linux_amd64
|
||||
systemctl start go2rtc
|
||||
msg_ok "Updated $APP"
|
||||
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/AlexxIT/go2rtc/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
if [[ "${RELEASE}" != "$(cat ~/.go2rtc 2>/dev/null)" ]] || [[ ! -f ~/.go2rtc ]]; then
|
||||
msg_info "Stopping service"
|
||||
systemctl stop go2rtc
|
||||
msg_ok "Stopped service"
|
||||
|
||||
fetch_and_deploy_gh_release "go2rtc" "AlexxIT/go2rtc" "singlefile" "latest" "/opt/go2rtc" "go2rtc_linux_amd64"
|
||||
|
||||
msg_info "Starting service"
|
||||
systemctl start go2rtc
|
||||
msg_ok "Started service"
|
||||
|
||||
msg_ok "Updated Successfully"
|
||||
else
|
||||
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
|
@ -13,15 +13,10 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing go2rtc"
|
||||
mkdir -p /opt/go2rtc
|
||||
cd /opt/go2rtc
|
||||
curl -fsSL "https://github.com/AlexxIT/go2rtc/releases/latest/download/go2rtc_linux_amd64" -o "go2rtc_linux_amd64"
|
||||
chmod +x go2rtc_linux_amd64
|
||||
msg_ok "Installed go2rtc"
|
||||
fetch_and_deploy_gh_release "go2rtc" "AlexxIT/go2rtc" "singlefile" "latest" "/opt/go2rtc" "go2rtc_linux_amd64"
|
||||
|
||||
msg_info "Creating Service"
|
||||
service_path="/etc/systemd/system/go2rtc.service"
|
||||
cat <<EOF >/etc/systemd/system/go2rtc.service
|
||||
echo "[Unit]
|
||||
Description=go2rtc service
|
||||
After=network.target
|
||||
@ -32,7 +27,8 @@ User=root
|
||||
ExecStart=/opt/go2rtc/go2rtc_linux_amd64
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target" >$service_path
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now go2rtc
|
||||
msg_ok "Created Service"
|
||||
|
||||
|
Reference in New Issue
Block a user