banlist: fail on unexpected errors

Also, don't output the 'already banned' error message
This commit is contained in:
Erik Arvstedt 2019-11-14 13:05:47 +01:00
parent e0276503ed
commit c36c496507
No known key found for this signature in database
GPG Key ID: 33312B944DD97846
1 changed files with 7 additions and 3 deletions

View File

@ -279,9 +279,13 @@ in {
sleep 1
done
echo "Importing node banlist..."
set +e
. ${./banlist.cli.txt}
true
cat ${./banlist.cli.txt} | while read line; do
if ! err=$(eval "$line" 2>&1) && [[ $err != *already\ banned* ]]; then
# unexpected error
echo "$err"
exit 1
fi
done
'';
serviceConfig = {
User = "${cfg.user}";