Skip to content

Commit b6bd8a6

Browse files
authored
Refactor (#6425)
1 parent ae7fe6e commit b6bd8a6

2 files changed

Lines changed: 32 additions & 19 deletions

File tree

ct/overseerr.sh

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,35 @@ function update_script() {
2727
msg_error "No ${APP} Installation Found!"
2828
exit
2929
fi
30-
msg_info "Updating $APP"
31-
systemctl stop overseerr
32-
cd /opt/overseerr
33-
output=$(git pull)
34-
$STD git pull
35-
if echo "$output" | grep -q "Already up to date."; then
36-
msg_ok " $APP is already up to date."
30+
31+
RELEASE=$(curl -fsSL https://api.github.com/repos/sct/overseerr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
32+
if [[ ! -f ~/.overseerr ]] || [[ "${RELEASE}" != "$(cat ~/.overseerr)" ]]; then
33+
msg_info "Stopping ${APP} service"
34+
systemctl stop overseerr
35+
msg_ok "Service stopped"
36+
37+
msg_info "Creating backup"
38+
mv /opt/overseerr/config /opt/config_backup
39+
msg_ok "Backup created"
40+
41+
fetch_and_deploy_gh_release "overseerr" "sct/overseerr" "tarball"
42+
rm -rf /opt/overseerr/config
43+
44+
msg_info "Configuring ${APP} (Patience)"
45+
cd /opt/overseerr
46+
$STD yarn install
47+
$STD yarn build
48+
mv /opt/config_backup /opt/overseerr/config
49+
msg_ok "Configured ${APP}"
50+
51+
msg_info "Starting ${APP} service"
3752
systemctl start overseerr
38-
exit
53+
msg_ok "Started ${APP} service"
54+
55+
msg_ok "Updated successfully!"
56+
else
57+
msg_ok "No update required. ${APP} is already at ${RELEASE}"
3958
fi
40-
$STD yarn install
41-
$STD yarn build
42-
systemctl start overseerr
43-
msg_ok "Updated $APP"
4459
exit
4560
}
4661

@@ -51,4 +66,4 @@ description
5166
msg_ok "Completed Successfully!\n"
5267
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
5368
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
54-
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5055${CL}"
69+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5055${CL}"

install/overseerr-install.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,17 @@ network_check
1414
update_os
1515

1616
msg_info "Installing Dependencies"
17-
$STD apt-get install -y \
18-
git \
19-
ca-certificates
17+
$STD apt-get install -y ca-certificates
2018
msg_ok "Installed Dependencies"
2119

2220
NODE_VERSION="22" NODE_MODULE="yarn@latest" setup_nodejs
21+
fetch_and_deploy_gh_release "overseerr" "sct/overseerr" "tarball"
2322

24-
msg_info "Installing Overseerr (Patience)"
25-
git clone -q https://github.com/sct/overseerr.git /opt/overseerr
23+
msg_info "Configuring Overseerr (Patience)"
2624
cd /opt/overseerr
2725
$STD yarn install
2826
$STD yarn build
29-
msg_ok "Installed Overseerr"
27+
msg_ok "Configured Overseerr"
3028

3129
msg_info "Creating Service"
3230
cat <<EOF >/etc/systemd/system/overseerr.service

0 commit comments

Comments
 (0)