mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-24 14:51:03 +01:00
circuitbreaker: start service when the node is ready and add to recovery (#1928)
This commit is contained in:
parent
d1b390b387
commit
e1a7daafc3
2 changed files with 19 additions and 1 deletions
|
@ -541,6 +541,15 @@ else
|
|||
echo "Sphinx-Relay - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# circuitbreaker
|
||||
if [ "${circuitbreaker}" = "on" ]; then
|
||||
echo "Provisioning CircuitBreaker - run config script" >> ${logFile}
|
||||
sudo sed -i "s/^message=.*/message='Setup CircuitBreaker'/g" ${infoFile}
|
||||
sudo -u admin /home/admin/config.scripts/bonus.circuitbreaker.sh on >> ${logFile} 2>&1
|
||||
else
|
||||
echo "Provisioning CircuitBreaker - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# custom install script from user
|
||||
customInstallAvailable=$(sudo ls /mnt/hdd/app-data/custom-installs.sh 2>/dev/null | grep -c "custom-installs.sh")
|
||||
if [ ${customInstallAvailable} -gt 0 ]; then
|
||||
|
|
|
@ -103,11 +103,20 @@ WantedBy=multi-user.target
|
|||
# setting value in raspi blitz config
|
||||
sudo sed -i "s/^circuitbreaker=.*/circuitbreaker=on/g" /mnt/hdd/raspiblitz.conf
|
||||
|
||||
isInstalled=$(sudo -u circuitbreaker /home/circuitbreaker/go/bin/circuitbreaker --version | grep -c "circuitbreaker version")
|
||||
if [ ${isInstalled} -eq 1 ]; then
|
||||
echo
|
||||
|
||||
source /home/admin/raspiblitz.info
|
||||
if [ "${state}" == "ready" ]; then
|
||||
echo "# OK - the circuitbreaker.service is enabled, system is on ready so starting service"
|
||||
sudo systemctl start circuitbreaker
|
||||
else
|
||||
echo "# OK - the circuitbreaker.service is enabled, to start manually use: sudo systemctl start circuitbreaker"
|
||||
fi
|
||||
echo
|
||||
echo "# Find more info at https://github.com/lightningequipment/circuitbreaker"
|
||||
echo
|
||||
echo "# Start in the background with: 'sudo systemctl start circuitbreaker'"
|
||||
echo "# Monitor with: 'sudo journalctl -fu circuitbreaker'"
|
||||
else
|
||||
echo "# Failed to install circuitbreaker "
|
||||
|
|
Loading…
Add table
Reference in a new issue