diff --git a/debian/debian-essentials.sh b/debian/debian-essentials.sh index 8b3f0ce..da7cc11 100755 --- a/debian/debian-essentials.sh +++ b/debian/debian-essentials.sh @@ -239,37 +239,6 @@ if [[ -f /usr/local/bin/wrestic ]] curl -sL $(curl -s https://api.github.com/repos/alvaro17f/wrestic/releases/latest | grep browser_download_url | cut -d '"' -f 4) | sudo tar zxf - -C /usr/local/bin --overwrite fi -# install cronicle worker -if [[ -f /opt/cronicle/conf/config.json ]] - then - isInFile=$(cat /opt/cronicle/conf/config.json | grep -c "192.168.1.4") - 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 - 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." -fi - - # sshd config cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak > /dev/null 2>&1 isInFile=$(cat /etc/hostname | grep -c "proxmox") diff --git a/debian/debian-install-cronicle-worker.sh b/debian/debian-install-cronicle-worker.sh index fe24257..8d1cc93 100755 --- a/debian/debian-install-cronicle-worker.sh +++ b/debian/debian-install-cronicle-worker.sh @@ -7,9 +7,20 @@ if [ "$EUID" -ne 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.4") + 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 @@ -22,7 +33,5 @@ if [ $isInFile -eq 0 ] 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 is installed." - else - echo "Cronicle worker is already installed." + echo "Cronicle worker installed." fi