mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-04 15:00:16 +00:00
Update pingvin.sh and pingvin-install.sh (#1819)
This commit is contained in:
parent
d366d24dea
commit
97002e7047
@ -32,30 +32,42 @@ function update_script() {
|
|||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
msg_info "Stopping Pingvin Share"
|
|
||||||
systemctl stop pm2-root.service
|
RELEASE=$(curl -s https://api.github.com/repos/stonith404/pingvin-share/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||||
msg_ok "Stopped Pingvin Share"
|
if [[ ! -f /opt/$pingvin_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/pingvin_version.txt)" ]]; then
|
||||||
|
|
||||||
|
msg_info "Stopping Pingvin Share"
|
||||||
|
systemctl stop pm2-root.service
|
||||||
|
msg_ok "Stopped Pingvin Share"
|
||||||
|
|
||||||
|
msg_info "Updating Pingvin Share to v${RELEASE}"
|
||||||
|
cd /opt
|
||||||
|
wget -q "https://github.com/stonith404/pingvin-share/archive/refs/tags/v${RELEASE}.zip"
|
||||||
|
unzip -q v${RELEASE}.zip
|
||||||
|
mv pingvin-share-${RELEASE} /opt/pingvin-share
|
||||||
|
cd /opt/pingvin-share
|
||||||
|
cd backend
|
||||||
|
npm install &>/dev/null
|
||||||
|
npm run build &>/dev/null
|
||||||
|
cd ../frontend
|
||||||
|
npm install &>/dev/null
|
||||||
|
npm run build &>/dev/null
|
||||||
|
echo "${RELEASE}" >"/opt/pingvin_version.txt"
|
||||||
|
rm -rf /opt/v${RELEASE}.zip
|
||||||
|
msg_ok "Updated Pingvin Share to v${RELEASE}"
|
||||||
|
|
||||||
msg_info "Updating Pingvin Share"
|
msg_info "Starting Pingvin Share"
|
||||||
cd /opt/pingvin-share
|
systemctl start pm2-root.service
|
||||||
git fetch --tags
|
msg_ok "Started Pingvin Share"
|
||||||
git checkout $(git describe --tags $(git rev-list --tags --max-count=1)) &>/dev/null
|
|
||||||
cd backend
|
|
||||||
npm install &>/dev/null
|
|
||||||
npm run build &>/dev/null
|
|
||||||
cd ../frontend
|
|
||||||
npm install &>/dev/null
|
|
||||||
npm run build &>/dev/null
|
|
||||||
msg_ok "Updated Pingvin Share"
|
|
||||||
|
|
||||||
msg_info "Starting Pingvin Share"
|
msg_ok "Updated Successfully"
|
||||||
systemctl start pm2-root.service
|
exit
|
||||||
msg_ok "Started Pingvin Share"
|
else
|
||||||
|
msg_ok "No update required. Pingvin Share is already at v${RELEASE}."
|
||||||
msg_ok "Updated Successfully"
|
fi
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
start
|
start
|
||||||
build_container
|
build_container
|
||||||
description
|
description
|
||||||
@ -63,4 +75,4 @@ description
|
|||||||
msg_ok "Completed Successfully!\n"
|
msg_ok "Completed Successfully!\n"
|
||||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||||
echo -e "${INFO}${YW} Access it using the following URL:${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}"
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
# Copyright (c) 2021-2025 tteck
|
# Copyright (c) 2021-2025 tteck
|
||||||
# Author: tteck (tteckster)
|
# Author: tteck (tteckster)
|
||||||
|
# Co-Author: michelroegl-brunner
|
||||||
# License: MIT
|
# License: MIT
|
||||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
|
|
||||||
@ -14,11 +15,12 @@ network_check
|
|||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apt-get install -y curl
|
$STD apt-get install -y \
|
||||||
$STD apt-get install -y sudo
|
curl \
|
||||||
$STD apt-get install -y mc
|
sudo \
|
||||||
$STD apt-get install -y git
|
mc \
|
||||||
$STD apt-get install -y gnupg
|
git \
|
||||||
|
gnupg
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
msg_info "Setting up Node.js Repository"
|
msg_info "Setting up Node.js Repository"
|
||||||
@ -34,11 +36,14 @@ $STD npm install pm2 -g
|
|||||||
msg_ok "Installed Node.js"
|
msg_ok "Installed Node.js"
|
||||||
|
|
||||||
msg_info "Installing Pingvin Share (Patience)"
|
msg_info "Installing Pingvin Share (Patience)"
|
||||||
git clone -q https://github.com/stonith404/pingvin-share /opt/pingvin-share
|
cd /opt
|
||||||
cd /opt/pingvin-share
|
RELEASE=$(curl -s https://api.github.com/repos/stonith404/pingvin-share/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||||
$STD git fetch --tags
|
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
|
||||||
$STD git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
|
wget -q "https://github.com/stonith404/pingvin-share/archive/refs/tags/v${RELEASE}.zip"
|
||||||
cd backend
|
unzip -q v${RELEASE}.zip
|
||||||
|
echo "${RELEASE}" >"/opt/pingvin_version.txt"
|
||||||
|
mv pingvin-share-${RELEASE} /opt/pingvin-share
|
||||||
|
cd /opt/pingvin-share/backend
|
||||||
$STD npm install
|
$STD npm install
|
||||||
$STD npm run build
|
$STD npm run build
|
||||||
$STD pm2 start --name="pingvin-share-backend" npm -- run prod
|
$STD pm2 start --name="pingvin-share-backend" npm -- run prod
|
||||||
@ -57,6 +62,7 @@ motd_ssh
|
|||||||
customize
|
customize
|
||||||
|
|
||||||
msg_info "Cleaning up"
|
msg_info "Cleaning up"
|
||||||
|
rm -rf /opt/v${RELEASE}.zip
|
||||||
$STD apt-get -y autoremove
|
$STD apt-get -y autoremove
|
||||||
$STD apt-get -y autoclean
|
$STD apt-get -y autoclean
|
||||||
msg_ok "Cleaned"
|
msg_ok "Cleaned"
|
||||||
|
Loading…
Reference in New Issue
Block a user