parent
8ef59b590a
commit
5867ef3288
25
ct/go2rtc.sh
25
ct/go2rtc.sh
@ -27,14 +27,23 @@ function update_script() {
|
|||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
msg_info "Updating $APP"
|
|
||||||
systemctl stop go2rtc
|
RELEASE=$(curl -fsSL https://api.github.com/repos/AlexxIT/go2rtc/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||||
cd /opt/go2rtc
|
if [[ "${RELEASE}" != "$(cat ~/.go2rtc 2>/dev/null)" ]] || [[ ! -f ~/.go2rtc ]]; then
|
||||||
rm go2rtc_linux_amd64
|
msg_info "Stopping service"
|
||||||
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")
|
systemctl stop go2rtc
|
||||||
chmod +x go2rtc_linux_amd64
|
msg_ok "Stopped service"
|
||||||
systemctl start go2rtc
|
|
||||||
msg_ok "Updated $APP"
|
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
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,15 +13,10 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing go2rtc"
|
fetch_and_deploy_gh_release "go2rtc" "AlexxIT/go2rtc" "singlefile" "latest" "/opt/go2rtc" "go2rtc_linux_amd64"
|
||||||
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"
|
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
service_path="/etc/systemd/system/go2rtc.service"
|
cat <<EOF >/etc/systemd/system/go2rtc.service
|
||||||
echo "[Unit]
|
echo "[Unit]
|
||||||
Description=go2rtc service
|
Description=go2rtc service
|
||||||
After=network.target
|
After=network.target
|
||||||
@ -32,7 +27,8 @@ User=root
|
|||||||
ExecStart=/opt/go2rtc/go2rtc_linux_amd64
|
ExecStart=/opt/go2rtc/go2rtc_linux_amd64
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target" >$service_path
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
systemctl enable -q --now go2rtc
|
systemctl enable -q --now go2rtc
|
||||||
msg_ok "Created Service"
|
msg_ok "Created Service"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user