From 40dcd4a455b7147a4f00baf4b9c2aadea2c744a4 Mon Sep 17 00:00:00 2001 From: akanealw Date: Wed, 18 Oct 2023 16:05:01 -0500 Subject: [PATCH] updated proxmox essentials script for cronicle --- proxmox/proxmox-pbs-essentials.sh | 25 +++++++++++++++++++++++++ proxmox/proxmox-pve-essentials.sh | 25 +++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/proxmox/proxmox-pbs-essentials.sh b/proxmox/proxmox-pbs-essentials.sh index caca5ba..39cc44c 100755 --- a/proxmox/proxmox-pbs-essentials.sh +++ b/proxmox/proxmox-pbs-essentials.sh @@ -109,3 +109,28 @@ if [ $isInFile -eq 0 ] else echo "Email already configured." fi + +# install cronicle worker +isInFile=$(cat /opt/cronicle/conf/config.json | grep -c "notify.akanealw@gmail.com") +if [ $isInFile -eq 0 ] + then + sudo apt-get update + sudo apt-get install -y ca-certificates curl gnupg + sudo mkdir -p /etc/apt/keyrings + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg + NODE_MAJOR=20 + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list + sudo apt-get update + sudo apt-get install nodejs -y + curl -s https://raw.githubusercontent.com/jhuckaby/Cronicle/master/bin/install.js | node + rm /opt/cronicle/conf/config.json + wget -qO /opt/cronicle/conf/config.json http://192.168.1.50/files/debian/cronicle-config.json + /opt/cronicle/bin/control.sh start + echo "Cronicle worker installed." + else + echo "Cronicle worker already installed." + /opt/cronicle/bin/control.sh stop + rm /opt/cronicle/conf/config.json + wget -qO /opt/cronicle/conf/config.json http://192.168.1.50/files/debian/cronicle-config.json + /opt/cronicle/bin/control.sh start +fi diff --git a/proxmox/proxmox-pve-essentials.sh b/proxmox/proxmox-pve-essentials.sh index f75b2d8..26d94be 100644 --- a/proxmox/proxmox-pve-essentials.sh +++ b/proxmox/proxmox-pve-essentials.sh @@ -118,3 +118,28 @@ if [ $isInFile -eq 0 ] else echo "Email already configured." fi + +# install cronicle worker +isInFile=$(cat /opt/cronicle/conf/config.json | grep -c "notify.akanealw@gmail.com") +if [ $isInFile -eq 0 ] + then + sudo apt-get update + sudo apt-get install -y ca-certificates curl gnupg + sudo mkdir -p /etc/apt/keyrings + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg + NODE_MAJOR=20 + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list + sudo apt-get update + sudo apt-get install nodejs -y + curl -s https://raw.githubusercontent.com/jhuckaby/Cronicle/master/bin/install.js | node + rm /opt/cronicle/conf/config.json + wget -qO /opt/cronicle/conf/config.json http://192.168.1.50/files/debian/cronicle-config.json + /opt/cronicle/bin/control.sh start + echo "Cronicle worker installed." + else + echo "Cronicle worker already installed." + /opt/cronicle/bin/control.sh stop + rm /opt/cronicle/conf/config.json + wget -qO /opt/cronicle/conf/config.json http://192.168.1.50/files/debian/cronicle-config.json + /opt/cronicle/bin/control.sh start +fi