From b101d330feda00f343da8346c92ff82e996195b5 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sun, 2 Dec 2018 20:43:48 +0100 Subject: [PATCH] fixed parameter --- home.admin/config.scripts/bonus.rtl.sh | 4 ++-- home.admin/config.scripts/internet.tor.sh | 4 ++-- home.admin/config.scripts/lnd.autonat.sh | 14 ++++++++++++-- home.admin/config.scripts/lnd.autopilot.sh | 8 ++++++-- home.admin/config.scripts/network.chain.sh | 8 +++++++- 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/home.admin/config.scripts/bonus.rtl.sh b/home.admin/config.scripts/bonus.rtl.sh index 5e4cc53..2774b91 100755 --- a/home.admin/config.scripts/bonus.rtl.sh +++ b/home.admin/config.scripts/bonus.rtl.sh @@ -21,7 +21,7 @@ echo "making sure services are not running" sudo systemctl stop RTL 2>/dev/null # switch on -if [ $1 -eq 1 ] || [ "$1" = "on" ]; then +if [ "$1" = "1" ] || [ "$1" = "on" ]; then echo "*** INSTALL RTL ***" # setting value in raspi blitz config @@ -72,7 +72,7 @@ if [ $1 -eq 1 ] || [ "$1" = "on" ]; then fi # switch off -if [ $1 -eq 0 ] || [ "$1" = "off" ]; then +if [ "$1" = "0" ] || [ "$1" = "off" ]; then echo "*** REMOVING RTL ***" # setting value in raspi blitz config diff --git a/home.admin/config.scripts/internet.tor.sh b/home.admin/config.scripts/internet.tor.sh index 90c698b..abff50a 100755 --- a/home.admin/config.scripts/internet.tor.sh +++ b/home.admin/config.scripts/internet.tor.sh @@ -31,7 +31,7 @@ sudo systemctl stop ${network}d 2>/dev/null sudo systemctl stop tor@default 2>/dev/null # switch on -if [ $1 -eq 1 ] || [ "$1" = "on" ]; then +if [ "$1" = "1" ] || [ "$1" = "on" ]; then echo "switching the TOR ON" # setting value in raspi blitz config @@ -232,7 +232,7 @@ EOF fi # switch off -if [ $1 -eq 0 ] || [ "$1" = "off" ]; then +if [ "$1" = "0" ] || [ "$1" = "off" ]; then echo "switching TOR OFF" # setting value in raspi blitz config diff --git a/home.admin/config.scripts/lnd.autonat.sh b/home.admin/config.scripts/lnd.autonat.sh index ff3bf63..1c3aa7d 100644 --- a/home.admin/config.scripts/lnd.autonat.sh +++ b/home.admin/config.scripts/lnd.autonat.sh @@ -27,17 +27,22 @@ echo "making sure services are not running" sudo systemctl stop lnd 2>/dev/null # switch on -if [ $1 -eq 1 ] || [ "$1" = "on" ]; then +if [ "$1" = "1" ] || [ "$1" = "on" ]; then echo "switching the LND autonat ON" # disable lnd service + echo "disable lnd" sudo systemctl disable lnd # editing lnd config + echo "editing /mnt/hdd/lnd/lnd.conf" sudo sed -i "s/^nat=.*/nat=true/g" /mnt/hdd/lnd/lnd.conf # editing lnd service (removing the static publicip) + echo "editing /etc/systemd/system/lnd.service" sudo sed -i "s/^ExecStart=/usr/local/bin/lnd --externalip=.*/ExecStart=/usr/local/bin/lnd/g" /etc/systemd/system/lnd.service # edit raspi blitz config + echo "editing /mnt/hdd/raspiblitz.conf" sudo sed -i "s/^autoNatDiscovery=.*/autoNatDiscovery=on/g" /mnt/hdd/raspiblitz.conf # enable lnd service + echo "enable lnd" sudo systemctl enable lnd echo "OK - autonat is now ON" echo "needs reboot to activate new setting" @@ -45,17 +50,22 @@ if [ $1 -eq 1 ] || [ "$1" = "on" ]; then fi # switch off -if [ $1 -eq 0 ] || [ "$1" = "off" ]; then +if [ "$1" = "0" ] || [ "$1" = "off" ]; then echo "switching the LND autonat OFF" # disable lnd service + echo "disable lnd" sudo systemctl disable lnd # editing lnd config + echo "editing /mnt/hdd/lnd/lnd.conf" sudo sed -i "s/^nat=.*/nat=false/g" /mnt/hdd/lnd/lnd.conf # editing lnd service (adding the static publicip) + echo "editing /etc/systemd/system/lnd.service" sudo sed -i "s/^lnd --externalip=.*/ExecStart=/usr/local/bin/lnd --externalip=${PUBLICIP}/g" /etc/systemd/system/lnd.service # edit raspi blitz config + echo "editing /mnt/hdd/raspiblitz.conf" sudo sed -i "s/^autoNatDiscovery=.*/autoNatDiscovery=off/g" /mnt/hdd/raspiblitz.conf # enable lnd service + echo "enable lnd" sudo systemctl enable lnd echo "OK - autonat is now OFF" echo "needs reboot to activate new setting" diff --git a/home.admin/config.scripts/lnd.autopilot.sh b/home.admin/config.scripts/lnd.autopilot.sh index 36ffa7f..a788f73 100644 --- a/home.admin/config.scripts/lnd.autopilot.sh +++ b/home.admin/config.scripts/lnd.autopilot.sh @@ -28,9 +28,11 @@ if [ ${valueExists} -eq 0 ]; then fi # switch on -if [ $1 -eq 1 ] || [ "$1" = "on" ]; then +if [ "$1" = "1" ] || [ "$1" = "on" ]; then echo "switching the LND autopilot ON" + echo "editing /mnt/hdd/lnd/lnd.conf" sudo sed -i "s/^autopilot.active=.*/autopilot.active=1/g" /mnt/hdd/lnd/lnd.conf + echo "editing /mnt/hdd/raspiblitz.conf" sudo sed -i "s/^autoPilot=.*/autoPilot=on/g" /mnt/hdd/raspiblitz.conf echo "OK - autopilot is now ON" echo "needs reboot to activate new setting" @@ -38,9 +40,11 @@ if [ $1 -eq 1 ] || [ "$1" = "on" ]; then fi # switch off -if [ $1 -eq 0 ] || [ "$1" = "off" ]; then +if [ "$1" = "0" ] || [ "$1" = "off" ]; then echo "switching the LND autopilot OFF" + echo "editing /mnt/hdd/lnd/lnd.conf" sudo sed -i "s/^autopilot.active=.*/autopilot.active=0/g" /mnt/hdd/lnd/lnd.conf + echo "editing /mnt/hdd/raspiblitz.conf" sudo sed -i "s/^autoPilot=.*/autoPilot=off/g" /mnt/hdd/raspiblitz.conf echo "OK - autopilot is now OFF" echo "needs reboot to activate new setting" diff --git a/home.admin/config.scripts/network.chain.sh b/home.admin/config.scripts/network.chain.sh index bfee942..16b2080 100755 --- a/home.admin/config.scripts/network.chain.sh +++ b/home.admin/config.scripts/network.chain.sh @@ -39,26 +39,32 @@ if [ "$1" = "testnet" ]; then sudo sed -i "s/^testnet=.*/testnet=1/g" /mnt/hdd/${network}/${network}.conf sudo sed -i "s/^testnet=.*/testnet=1/g" /home/admin/.${network}/${network}.conf else + echo "editing /mnt/hdd/${network}/${network}.conf" sudo sed -i "s/^testnet=.*/testnet=0/g" /mnt/hdd/${network}/${network}.conf + echo "editing /home/admin/.${network}/${network}.conf" sudo sed -i "s/^testnet=.*/testnet=0/g" /home/admin/.${network}/${network}.conf fi # editing lnd config files (hdd & admin user) echo "edit lightning config .." if [ "$1" = "testnet" ]; then + echo "editing /mnt/hdd/lnd/lnd.conf" sudo sed -i "s/^${network}.mainnet.*/${network}.mainnet=0/g" /mnt/hdd/lnd/lnd.conf sudo sed -i "s/^${network}.testnet.*/${network}.testnet=1/g" /mnt/hdd/lnd/lnd.conf + echo "editing /home/admin/.lnd/lnd.conf" sudo sed -i "s/^${network}.mainnet.*/${network}.mainnet=0/g" /home/admin/.lnd/lnd.conf sudo sed -i "s/^${network}.testnet.*/${network}.testnet=1/g" /home/admin/.lnd/lnd.conf else + echo "editing /mnt/hdd/lnd/lnd.conf" sudo sed -i "s/^${network}.mainnet.*/${network}.mainnet=1/g" /mnt/hdd/lnd/lnd.conf sudo sed -i "s/^${network}.testnet.*/${network}.testnet=0/g" /mnt/hdd/lnd/lnd.conf + echo "editing /home/admin/.lnd/lnd.conf" sudo sed -i "s/^${network}.mainnet.*/${network}.mainnet=1/g" /home/admin/.lnd/lnd.conf sudo sed -i "s/^${network}.testnet.*/${network}.testnet=0/g" /home/admin/.lnd/lnd.conf fi # editing the raspi blitz config file -echo "edit raspiblitz config .." +echo "editing /mnt/hdd/raspiblitz.conf" if [ "$1" = "testnet" ]; then sudo sed -i "s/^chain=.*/chain=test/g" /mnt/hdd/raspiblitz.conf else