Update cronicle.sh

check for npm
pull/2299/head
tteckster 2024-01-03 01:25:05 -05:00 committed by GitHub
parent 6e51ac0e69
commit ba6eea5346
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

View File

@ -59,12 +59,26 @@ UPD=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SUPPORT" --radio
if [ "$UPD" == "1" ]; then if [ "$UPD" == "1" ]; then
header_info header_info
if [[ ! -d /opt/cronicle ]]; then msg_error "No ${APP} Installation Found!"; exit; fi if [[ ! -d /opt/cronicle ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
if [[ "$(node -v | cut -d 'v' -f 2)" == "18."* ]]; then
if ! command -v npm >/dev/null 2>&1; then
echo "Installing NPM..."
apt-get install -y npm >/dev/null 2>&1
echo "Installed NPM..."
fi
fi
msg_info "Updating ${APP}" msg_info "Updating ${APP}"
/opt/cronicle/bin/control.sh upgrade &>/dev/null /opt/cronicle/bin/control.sh upgrade &>/dev/null
msg_ok "Updated ${APP}" msg_ok "Updated ${APP}"
exit exit
fi fi
if [ "$UPD" == "2" ]; then if [ "$UPD" == "2" ]; then
if [[ "$(node -v | cut -d 'v' -f 2)" == "18."* ]]; then
if ! command -v npm >/dev/null 2>&1; then
echo "Installing NPM..."
apt-get install -y npm >/dev/null 2>&1
echo "Installed NPM..."
fi
fi
LATEST=$(curl -sL https://api.github.com/repos/jhuckaby/Cronicle/releases/latest | grep '"tag_name":' | cut -d'"' -f4) LATEST=$(curl -sL https://api.github.com/repos/jhuckaby/Cronicle/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
IP=$(hostname -I | awk '{print $1}') IP=$(hostname -I | awk '{print $1}')
msg_info "Installing Dependencies" msg_info "Installing Dependencies"