Skip to content

Commit e253fe6

Browse files
authored
ChangeDetection Update: Update also Browsers (#1027)
* Changedetection: Update also browsers * Changedetection: Adding more msg for updating, Make code more readable
1 parent 4b0fff5 commit e253fe6

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

ct/changedetection.sh

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,45 @@ function update_script() {
2828
header_info
2929
check_container_storage
3030
check_container_resources
31+
3132
if [[ ! -f /etc/systemd/system/changedetection.service ]]; then
3233
msg_error "No ${APP} Installation Found!"
3334
exit
3435
fi
35-
msg_info "Updating ${APP} LXC"
36+
3637
if ! dpkg -s libjpeg-dev >/dev/null 2>&1; then
38+
msg_info "Installing Dependencies"
3739
apt-get update
3840
apt-get install -y libjpeg-dev
41+
msg_ok "Updated Dependencies"
3942
fi
43+
44+
msg_info "Updating ${APP}"
4045
pip3 install changedetection.io --upgrade &>/dev/null
46+
msg_ok "Updated ${APP}"
47+
48+
msg_info "Updating Playwright"
4149
pip3 install playwright --upgrade &>/dev/null
50+
msg_ok "Updated Playwright"
51+
4252
if [[ -f /etc/systemd/system/browserless.service ]]; then
53+
msg_info "Updating Browserless (Patience)"
4354
git -C /opt/browserless/ fetch --all &>/dev/null
4455
git -C /opt/browserless/ reset --hard origin/main &>/dev/null
4556
npm update --prefix /opt/browserless &>/dev/null
57+
/opt/browserless/node_modules/playwright-core/cli.js install --with-deps &>/dev/null
58+
# Update Chrome separately, as it has to be done with the force option. Otherwise the installation of other browsers will not be done if Chrome is already installed.
59+
/opt/browserless/node_modules/playwright-core/cli.js install --force chrome &>/dev/null
60+
/opt/browserless/node_modules/playwright-core/cli.js install chromium firefox webkit &>/dev/null
4661
npm run build --prefix /opt/browserless &>/dev/null
4762
npm run build:function --prefix /opt/browserless &>/dev/null
4863
npm prune production --prefix /opt/browserless &>/dev/null
4964
systemctl restart browserless
65+
msg_ok "Updated Browserless"
5066
else
5167
msg_error "No Browserless Installation Found!"
5268
fi
69+
5370
systemctl restart changedetection
5471
msg_ok "Updated Successfully"
5572
exit
@@ -62,4 +79,4 @@ description
6279
msg_ok "Completed Successfully!\n"
6380
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
6481
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
65-
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5000${CL}"
82+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5000${CL}"

0 commit comments

Comments
 (0)