updated cronicle worker install
This commit is contained in:
@@ -111,9 +111,20 @@ if [ $isInFile -eq 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.50")
|
||||||
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
|
||||||
@@ -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
|
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 installed."
|
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
|
fi
|
||||||
|
|||||||
@@ -120,9 +120,20 @@ if [ $isInFile -eq 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.50")
|
||||||
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
|
||||||
@@ -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
|
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 installed."
|
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
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user