Refactor (#6528)
This commit is contained in:
parent
46728b01fe
commit
1c7a39438c
@ -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}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"
|
||||
|
@ -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",
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user