autounlock rewrite

This commit is contained in:
rootzoll 2020-05-28 01:52:05 +02:00
parent 9bd1d6c2bd
commit f3d305329d
2 changed files with 4 additions and 8 deletions

View File

@ -296,11 +296,7 @@ do
if [ ${locked} -gt 0 ]; then
echo "STARTING AUTO-UNLOCK ..."
# building REST command
passwordC=$(sudo cat /root/lnd.autounlock.pwd)
command="sudo python3 /home/admin/config.scripts/lnd.unlock.py '${passwordC}'"
bash -c "${command}"
sudo /home/admin/config.scripts/lnd.unlock.sh '${passwordC}'
fi
fi

View File

@ -49,9 +49,9 @@ Password C will be stored on the device.
echo "SYSTEMD RESTART LOG: lightning (LND)" > /home/admin/systemd.lightning.log
sudo systemctl restart lnd
sleep 4
result=$(sudo python /home/admin/config.scripts/lnd.unlock.py ${passwordC})
invalid=$(echo "${result}" | grep -c 'invalid')
if [ ${invalid} -gt 0 ];then
error=""
source <(sudo /home/admin/config.scripts/lnd.unlock.sh '${passwordC}')
if [ ${error} -gt 0 ];then
echo "# PASSWORD C is wrong - try again or cancel"
sleep 3
sudo /home/admin/config.scripts/lnd.autounlock.sh on