Refactor (#6425)
This commit is contained in:
parent
ae7fe6e3e1
commit
b6bd8a6de4
@ -27,20 +27,35 @@ function update_script() {
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
msg_info "Updating $APP"
|
||||
systemctl stop overseerr
|
||||
cd /opt/overseerr
|
||||
output=$(git pull)
|
||||
$STD git pull
|
||||
if echo "$output" | grep -q "Already up to date."; then
|
||||
msg_ok " $APP is already up to date."
|
||||
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/sct/overseerr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
if [[ ! -f ~/.overseerr ]] || [[ "${RELEASE}" != "$(cat ~/.overseerr)" ]]; then
|
||||
msg_info "Stopping ${APP} service"
|
||||
systemctl stop overseerr
|
||||
msg_ok "Service stopped"
|
||||
|
||||
msg_info "Creating backup"
|
||||
mv /opt/overseerr/config /opt/config_backup
|
||||
msg_ok "Backup created"
|
||||
|
||||
fetch_and_deploy_gh_release "overseerr" "sct/overseerr" "tarball"
|
||||
rm -rf /opt/overseerr/config
|
||||
|
||||
msg_info "Configuring ${APP} (Patience)"
|
||||
cd /opt/overseerr
|
||||
$STD yarn install
|
||||
$STD yarn build
|
||||
mv /opt/config_backup /opt/overseerr/config
|
||||
msg_ok "Configured ${APP}"
|
||||
|
||||
msg_info "Starting ${APP} service"
|
||||
systemctl start overseerr
|
||||
exit
|
||||
msg_ok "Started ${APP} service"
|
||||
|
||||
msg_ok "Updated successfully!"
|
||||
else
|
||||
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
||||
fi
|
||||
$STD yarn install
|
||||
$STD yarn build
|
||||
systemctl start overseerr
|
||||
msg_ok "Updated $APP"
|
||||
exit
|
||||
}
|
||||
|
||||
@ -51,4 +66,4 @@ description
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5055${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5055${CL}"
|
||||
|
@ -14,19 +14,17 @@ network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
git \
|
||||
ca-certificates
|
||||
$STD apt-get install -y ca-certificates
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
NODE_VERSION="22" NODE_MODULE="yarn@latest" setup_nodejs
|
||||
fetch_and_deploy_gh_release "overseerr" "sct/overseerr" "tarball"
|
||||
|
||||
msg_info "Installing Overseerr (Patience)"
|
||||
git clone -q https://github.com/sct/overseerr.git /opt/overseerr
|
||||
msg_info "Configuring Overseerr (Patience)"
|
||||
cd /opt/overseerr
|
||||
$STD yarn install
|
||||
$STD yarn build
|
||||
msg_ok "Installed Overseerr"
|
||||
msg_ok "Configured Overseerr"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/overseerr.service
|
||||
|
Loading…
x
Reference in New Issue
Block a user