mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-10-06 18:12:14 +02:00
added autonat to settings #129
This commit is contained in:
@@ -7,6 +7,7 @@ source /mnt/hdd/raspiblitz.conf
|
|||||||
CHOICES=$(dialog --checklist "Activate/Deactivate Services:" 15 40 5 \
|
CHOICES=$(dialog --checklist "Activate/Deactivate Services:" 15 40 5 \
|
||||||
1 "Channel Autopilot" ${autoPilot} \
|
1 "Channel Autopilot" ${autoPilot} \
|
||||||
2 "Testnet" ${chain} \
|
2 "Testnet" ${chain} \
|
||||||
|
3 "Router AutoNAT" ${autoNatDiscovery} \
|
||||||
2>&1 >/dev/tty)
|
2>&1 >/dev/tty)
|
||||||
#CHOICES=$(dialog --checklist "Activate/Deactivate Services:" 15 40 5 \
|
#CHOICES=$(dialog --checklist "Activate/Deactivate Services:" 15 40 5 \
|
||||||
#1 "Channel Autopilot" ${autoPilot} \
|
#1 "Channel Autopilot" ${autoPilot} \
|
||||||
@@ -59,6 +60,25 @@ else
|
|||||||
echo "Testnet Setting unchanged."
|
echo "Testnet Setting unchanged."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# AUTONAT process choice
|
||||||
|
choice="off"; check=$(echo "${CHOICES}" | grep -c "3")
|
||||||
|
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||||
|
if [ "${autoNatDiscovery}" != "${choice}" ]; then
|
||||||
|
echo "AutoNAT Setting changed"
|
||||||
|
echo "Stopping Services"
|
||||||
|
sudo systemctl stop lnd
|
||||||
|
sudo systemctl stop ${network}d
|
||||||
|
echo "Disable LND"
|
||||||
|
sudo systemctl disable lnd
|
||||||
|
echo "Executing change"
|
||||||
|
sudo /home/admin/config.scripts/lnd.autonat.sh ${choice}
|
||||||
|
echo "Enable LND"
|
||||||
|
sudo systemctl enable lnd
|
||||||
|
needsReboot=1
|
||||||
|
else
|
||||||
|
echo "Autopilot Setting unchanged."
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ${needsReboot} -eq 1 ]; then
|
if [ ${needsReboot} -eq 1 ]; then
|
||||||
dialog --title 'OK' --msgbox 'System will reboot to activate changes.' 5 25
|
dialog --title 'OK' --msgbox 'System will reboot to activate changes.' 5 25
|
||||||
sudo shutdown -r now
|
sudo shutdown -r now
|
||||||
|
Reference in New Issue
Block a user