moved cronicle to a standalone script
This commit is contained in:
31
debian/debian-essentials.sh
vendored
31
debian/debian-essentials.sh
vendored
@@ -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
|
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
|
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
|
# sshd config
|
||||||
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak > /dev/null 2>&1
|
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak > /dev/null 2>&1
|
||||||
isInFile=$(cat /etc/hostname | grep -c "proxmox")
|
isInFile=$(cat /etc/hostname | grep -c "proxmox")
|
||||||
|
|||||||
17
debian/debian-install-cronicle-worker.sh
vendored
17
debian/debian-install-cronicle-worker.sh
vendored
@@ -7,9 +7,20 @@ if [ "$EUID" -ne 0 ]
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# install cronicle worker
|
# install cronicle worker
|
||||||
isInFile=$(cat /opt/cronicle/conf/config.json | grep -c "notify.akanealw@gmail.com")
|
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 ]
|
if [ $isInFile -eq 0 ]
|
||||||
then
|
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 update
|
||||||
sudo apt-get install -y ca-certificates curl gnupg
|
sudo apt-get install -y ca-certificates curl gnupg
|
||||||
sudo mkdir -p /etc/apt/keyrings
|
sudo mkdir -p /etc/apt/keyrings
|
||||||
@@ -22,7 +33,5 @@ if [ $isInFile -eq 0 ]
|
|||||||
rm /opt/cronicle/conf/config.json
|
rm /opt/cronicle/conf/config.json
|
||||||
wget -qO /opt/cronicle/conf/config.json http://192.168.1.50/files/debian/cronicle-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
|
/opt/cronicle/bin/control.sh start
|
||||||
echo "Cronicle worker is installed."
|
echo "Cronicle worker installed."
|
||||||
else
|
|
||||||
echo "Cronicle worker is already installed."
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user