diff --git a/ct/pairdrop.sh b/ct/pairdrop.sh index 057606c5d..2657d09de 100644 --- a/ct/pairdrop.sh +++ b/ct/pairdrop.sh @@ -27,13 +27,28 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - msg_info "Updating $APP" - systemctl stop pairdrop - cd /opt/pairdrop - git pull - npm install - systemctl start pairdrop - msg_ok "Updated $APP" + + RELEASE=$(curl -fsSL https://api.github.com/repos/schlagmichdoch/PairDrop/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') + if [[ ! -f ~/.pairdrop ]] || [[ "${RELEASE}" != "$(cat ~/.pairdrop)" ]]; then + msg_info "Stopping ${APP}" + systemctl stop pairdrop + msg_ok "Stopped ${APP}" + + fetch_and_deploy_gh_release "pairdrop" "schlagmichdoch/PairDrop" "tarball" + + msg_info "Configuring PairDrop" + cd /opt/pairdrop + $STD npm install + msg_ok "Configured PairDrop" + + msg_info "Starting ${APP}" + systemctl start pairdrop + msg_ok "Started ${APP}" + + msg_ok "Updated Successfully" + else + msg_ok "No update required. ${APP} is already at ${RELEASE}." + fi exit } @@ -44,4 +59,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}:3000${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" diff --git a/frontend/public/json/pairdrop.json b/frontend/public/json/pairdrop.json index d18a824b7..d5e4d7e26 100644 --- a/frontend/public/json/pairdrop.json +++ b/frontend/public/json/pairdrop.json @@ -6,7 +6,7 @@ ], "date_created": "2024-05-02", "type": "ct", - "updateable": false, + "updateable": true, "privileged": false, "interface_port": 3000, "documentation": "https://github.com/schlagmichdoch/PairDrop/blob/master/docs/host-your-own.md", diff --git a/install/pairdrop-install.sh b/install/pairdrop-install.sh index 751311dd2..e4216ab35 100644 --- a/install/pairdrop-install.sh +++ b/install/pairdrop-install.sh @@ -13,15 +13,10 @@ setting_up_container network_check update_os -msg_info "Installing Dependencies" -$STD apt-get install -y \ - git -msg_ok "Installed Dependencies" - NODE_VERSION="22" setup_nodejs +fetch_and_deploy_gh_release "pairdrop" "schlagmichdoch/PairDrop" "tarball" -msg_info "Installing PairDrop" -git clone -q https://github.com/schlagmichdoch/PairDrop.git /opt/pairdrop +msg_info "Configuring PairDrop" cd /opt/pairdrop $STD npm install msg_ok "Installed PairDrop"