fix errors on infoscreen

This commit is contained in:
rootzoll 2020-06-02 23:40:35 +02:00
parent 0612edc99e
commit 3a1d30d444
3 changed files with 15 additions and 13 deletions

View File

@ -292,7 +292,7 @@ if [ "${baseImage}" = "armbian" ]; then
fi
# dependencies for minimal images
sudo apt install -y python3-venv python3-dev python3-wheel
sudo apt install -y python3-venv python3-dev python3-wheel python3-jinja2
# rsync is needed to copy from HDD
sudo apt install -y rsync
@ -592,9 +592,10 @@ echo "*** Python DEFAULT libs & depenedencies ***"
sudo apt-get -y install dialog bc python3-dialog
# libs (for global python scripts)
sudo pip3 install -I grpcio==1.29.0
sudo pip3 install -I googleapis-common-protos==1.51.0
sudo pip3 install -I toml==0.10.1
sudo -H python3 -m pip install grpcio==1.29.0
sudo -H python3 -m pip install googleapis-common-protos==1.51.0
sudo -H python3 -m pip install toml==0.10.1
sudo -H python3 -m pip install j2cli==0.3.10
echo ""
echo "*** RASPIBLITZ EXTRAS ***"
@ -685,7 +686,7 @@ echo "*** HARDENING ***"
# based on https://stadicus.github.io/RaspiBolt/raspibolt_21_security.html
# fail2ban (no config required)
sudo apt-get install -y --no-install-recommends python3-systemd fail2ban
sudo apt-get install -y --no-install-recommends python3-systemd fail2ban
if [ "${baseImage}" = "raspbian" ]; then
echo ""

View File

@ -407,12 +407,14 @@ if [ "${EUID}" = "$(id -u pi)" ]; then
EOF
# use Jinja2 and apply json data to template to produce static html file
res=$(/usr/local/bin/j2 /var/www/blitzweb/info/info.j2 /var/cache/raspiblitz/info.json -o /var/cache/raspiblitz/info.html)
if ! [ $? -eq 0 ]; then
echo "an error occured.. maybe JSON syntax is wrong..!"
echo "${res}"
templateExists=$(sudo ls /var/cache/raspiblitz/info.html 2>/dev/null | grep -c 'info.html')
if [ ${templateExists} -gt 0 ]; then
res=$(/usr/local/bin/j2 /var/www/blitzweb/info/info.j2 /var/cache/raspiblitz/info.json -o /var/cache/raspiblitz/info.html)
if ! [ $? -eq 0 ]; then
echo "an error occured.. maybe JSON syntax is wrong..!"
echo "${res}"
fi
fi
fi
# EOF
# EOF

View File

@ -178,7 +178,6 @@ elif [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo apt-get install python3-jinja2 >/dev/null
sudo -H python3 -m pip install j2cli
# create nginx app-data dir and use LND cert by default
sudo mkdir /mnt/hdd/app-data/nginx/ 2>/dev/null
sudo ln -sf /mnt/hdd/lnd/tls.cert /mnt/hdd/app-data/nginx/tls.cert