Browse Source

fixed parameter

#146
rootzoll 6 years ago
parent
commit
b101d330fe
  1. 4
      home.admin/config.scripts/bonus.rtl.sh
  2. 4
      home.admin/config.scripts/internet.tor.sh
  3. 14
      home.admin/config.scripts/lnd.autonat.sh
  4. 8
      home.admin/config.scripts/lnd.autopilot.sh
  5. 8
      home.admin/config.scripts/network.chain.sh

4
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

4
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

14
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"

8
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"

8
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

Loading…
Cancel
Save