From 6dd26bd3c497a082389d5ec09811facbcb9a2fdb Mon Sep 17 00:00:00 2001 From: akanealw Date: Thu, 19 Oct 2023 05:34:36 -0500 Subject: [PATCH] updated cronicle worker install --- proxmox/proxmox-pbs-essentials.sh | 21 +++++++++++++-------- proxmox/proxmox-pve-essentials.sh | 21 +++++++++++++-------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/proxmox/proxmox-pbs-essentials.sh b/proxmox/proxmox-pbs-essentials.sh index 39cc44c..85478a3 100755 --- a/proxmox/proxmox-pbs-essentials.sh +++ b/proxmox/proxmox-pbs-essentials.sh @@ -111,9 +111,20 @@ if [ $isInFile -eq 0 ] fi # install cronicle worker -isInFile=$(cat /opt/cronicle/conf/config.json | grep -c "notify.akanealw@gmail.com") -if [ $isInFile -eq 0 ] +if [[ -f /opt/cronicle/conf/config.json ]] then + isInFile=$(cat /opt/cronicle/conf/config.json | grep -c "192.168.1.50") + if [ $isInFile -eq 0 ] + then + /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 + echo "Cronicle config updated." + else + echo "Cronicle worker already installed." + fi + else sudo apt-get update sudo apt-get install -y ca-certificates curl gnupg sudo mkdir -p /etc/apt/keyrings @@ -127,10 +138,4 @@ if [ $isInFile -eq 0 ] 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 26d94be..599d8be 100644 --- a/proxmox/proxmox-pve-essentials.sh +++ b/proxmox/proxmox-pve-essentials.sh @@ -120,9 +120,20 @@ if [ $isInFile -eq 0 ] fi # install cronicle worker -isInFile=$(cat /opt/cronicle/conf/config.json | grep -c "notify.akanealw@gmail.com") -if [ $isInFile -eq 0 ] +if [[ -f /opt/cronicle/conf/config.json ]] then + isInFile=$(cat /opt/cronicle/conf/config.json | grep -c "192.168.1.50") + if [ $isInFile -eq 0 ] + then + /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 + echo "Cronicle config updated." + else + echo "Cronicle worker already installed." + fi + else sudo apt-get update sudo apt-get install -y ca-certificates curl gnupg sudo mkdir -p /etc/apt/keyrings @@ -136,10 +147,4 @@ if [ $isInFile -eq 0 ] 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