Refactor (#6422)
This commit is contained in:
parent
9b2b794f9c
commit
c7a1334b29
31
ct/ombi.sh
31
ct/ombi.sh
@ -27,22 +27,29 @@ function update_script() {
|
|||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/Ombi-app/Ombi/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
|
|
||||||
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
RELEASE=$(curl -fsSL https://api.github.com/repos/Ombi-app/Ombi/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||||
msg_info "Stopping ${APP}"
|
if [[ "${RELEASE}" != "$(cat ~/.ombi)" ]] || [[ ! -f ~/.ombi ]]; then
|
||||||
|
msg_info "Stopping ${APP} service"
|
||||||
systemctl stop ombi
|
systemctl stop ombi
|
||||||
msg_ok "Stopped ${APP}"
|
msg_ok "Stopped ${APP} service"
|
||||||
|
|
||||||
msg_info "Updating ${APP} to ${RELEASE}"
|
msg_info "Creating backup"
|
||||||
curl -fsSL "https://github.com/Ombi-app/Ombi/releases/download/${RELEASE}/linux-x64.tar.gz" -o $(basename "https://github.com/Ombi-app/Ombi/releases/download/${RELEASE}/linux-x64.tar.gz")
|
[[ -f /opt/ombi/Ombi.db ]] && mv /opt/ombi/Ombi.db /opt
|
||||||
tar -xzf linux-x64.tar.gz -C /opt/ombi
|
[[ -f /opt/ombi/OmbiExternal.db ]] && mv /opt/ombi/OmbiExternal.db /opt
|
||||||
rm -rf linux-x64.tar.gz
|
[[ -f /opt/ombi/OmbiSettings.db ]] && mv /opt/ombi/OmbiSettings.db /opt
|
||||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
msg_ok "Backup created"
|
||||||
msg_ok "Updated ${APP} to ${RELEASE}"
|
|
||||||
|
|
||||||
msg_info "Starting ${APP}"
|
rm -rf /opt/ombi
|
||||||
|
fetch_and_deploy_gh_release "ombi" "Ombi-app/Ombi" "prebuild" "latest" "/opt/ombi" "linux-x64.tar.gz"
|
||||||
|
[[ -f /opt/Ombi.db ]] && mv /opt/Ombi.db /opt/ombi
|
||||||
|
[[ -f /opt/OmbiExternal.db ]] && mv /opt/OmbiExternal.db /opt/ombi
|
||||||
|
[[ -f /opt/OmbiSettings.db ]] && mv /opt/OmbiSettings.db /opt/ombi
|
||||||
|
|
||||||
|
msg_info "Starting ${APP} service"
|
||||||
systemctl start ombi
|
systemctl start ombi
|
||||||
msg_ok "Started ${APP}"
|
msg_ok "Started ${APP} service"
|
||||||
|
|
||||||
msg_ok "Updated Successfully"
|
msg_ok "Updated Successfully"
|
||||||
else
|
else
|
||||||
msg_ok "No update required. ${APP} ia already at ${RELEASE}."
|
msg_ok "No update required. ${APP} ia already at ${RELEASE}."
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
],
|
],
|
||||||
"date_created": "2024-05-02",
|
"date_created": "2024-05-02",
|
||||||
"type": "ct",
|
"type": "ct",
|
||||||
"updateable": false,
|
"updateable": true,
|
||||||
"privileged": false,
|
"privileged": false,
|
||||||
"interface_port": 5000,
|
"interface_port": 5000,
|
||||||
"documentation": "https://docs.ombi.app/",
|
"documentation": "https://docs.ombi.app/",
|
||||||
|
@ -13,14 +13,7 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Ombi"
|
fetch_and_deploy_gh_release "ombi" "Ombi-app/Ombi" "prebuild" "latest" "/opt/ombi" "linux-x64.tar.gz"
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/Ombi-app/Ombi/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
|
|
||||||
curl -fsSL "https://github.com/Ombi-app/Ombi/releases/download/${RELEASE}/linux-x64.tar.gz" -o "linux-x64.tar.gz"
|
|
||||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
|
||||||
mkdir -p /opt/ombi
|
|
||||||
tar -xzf linux-x64.tar.gz -C /opt/ombi
|
|
||||||
rm -rf linux-x64.tar.gz
|
|
||||||
msg_ok "Installed Ombi"
|
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
cat <<EOF >/etc/systemd/system/ombi.service
|
cat <<EOF >/etc/systemd/system/ombi.service
|
||||||
|
Loading…
x
Reference in New Issue
Block a user