services:use grep to check entries in conf

This commit is contained in:
openoms
2020-01-11 09:38:17 +00:00
parent b91043cb22
commit 3b2f867a84
6 changed files with 15 additions and 14 deletions

View File

@@ -11,11 +11,11 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
exit 1
fi
# add default value to raspi config if needed
source /mnt/hdd/raspiblitz.conf
if [ ${#BTCRPCexplorer} -eq 0 ]; then
# add default value to raspi config if needed
if ! grep -Eq "^BTCRPCexplorer=" /mnt/hdd/raspiblitz.conf; then
echo "BTCRPCexplorer=off" >> /mnt/hdd/raspiblitz.conf
source /mnt/hdd/raspiblitz.conf
fi
# status

View File

@@ -12,10 +12,10 @@ fi
source /mnt/hdd/raspiblitz.conf
# add default value to raspi config if needed
if [ ${#BTCPayServer} -eq 0 ]; then
if ! grep -Eq "^BTCPayServer=" /mnt/hdd/raspiblitz.conf; then
echo "BTCPayServer=off" >> /mnt/hdd/raspiblitz.conf
fi
# stop services
echo "making sure services are not running"
sudo systemctl stop nbxplorer 2>/dev/null

View File

@@ -53,9 +53,8 @@ fi
# add default value to raspi config if needed
if [ ${#ElectRS} -eq 0 ]; then
if ! grep -Eq "^ElectRS=" /mnt/hdd/raspiblitz.conf; then
echo "ElectRS=off" >> /mnt/hdd/raspiblitz.conf
ElectRS=off
fi
# stop service

View File

@@ -7,11 +7,11 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
exit 1
fi
# add default value to raspi config if needed
source /mnt/hdd/raspiblitz.conf
if [ ${#lndmanage} -eq 0 ]; then
# add default value to raspi config if needed
if ! grep -Eq "^lndmanage=" /mnt/hdd/raspiblitz.conf; then
echo "lndmanage=off" >> /mnt/hdd/raspiblitz.conf
source /mnt/hdd/raspiblitz.conf
fi
# install

View File

@@ -7,11 +7,11 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
exit 1
fi
# add default value to raspi config if needed
source /mnt/hdd/raspiblitz.conf
if [ ${#loop} -eq 0 ]; then
# add default value to raspi config if needed
if ! grep -Eq "^loop=" /mnt/hdd/raspiblitz.conf; then
echo "loop=off" >> /mnt/hdd/raspiblitz.conf
source /mnt/hdd/raspiblitz.conf
fi
# stop services

View File

@@ -16,8 +16,10 @@ if [ ${#network} -eq 0 ]; then
exit 1
fi
source /mnt/hdd/raspiblitz.conf
# add default value to raspi config if needed
if [ ${#rtlWebinterface} -eq 0 ]; then
if ! grep -Eq "^rtlWebinterface=" /mnt/hdd/raspiblitz.conf; then
echo "rtlWebinterface=off" >> /mnt/hdd/raspiblitz.conf
fi