Check integrity of configuration file

This commit is contained in:
q3aql 2024-04-14 20:41:58 +02:00
parent 190c4e1b7a
commit 40b794e6f4

View File

@ -78,8 +78,27 @@ else
echo "always_ip_allowed=\"192.168.0.1 192.168.0.2\"" >> /etc/blockauth/blockauth.conf
echo "blocklist=\"/etc/blockauth/blocklist.list\"" >> /etc/blockauth/blockauth.conf
echo "filelog=\"/etc/blockauth/blockauth.log\"" >> /etc/blockauth/blockauth.conf
echo "max_ip_blocklist=\"12500\"" >> /etc/blockauth/blockauth.conf
fi
# Check integrity of configuration file
if [ -z "${valid_users}" ] ; then
echo "valid_users=\"test1 test2\"" >> /etc/blockauth/blockauth.conf
fi
if [ -z "${always_ip_allowed}" ] ; then
echo "always_ip_allowed=\"192.168.0.1 192.168.0.2\"" >> /etc/blockauth/blockauth.conf
fi
if [ -z "${blocklist}" ] ; then
echo "blocklist=\"/etc/blockauth/blocklist.list\"" >> /etc/blockauth/blockauth.conf
fi
if [ -z "${filelog}" ] ; then
echo "filelog=\"/etc/blockauth/blockauth.log\"" >> /etc/blockauth/blockauth.conf
fi
if [ -z "${max_ip_blocklist}" ] ; then
echo "max_ip_blocklist=\"12500\"" >> /etc/blockauth/blockauth.conf
fi
source /etc/blockauth/blockauth.conf
echo "blockauth: running process"
blockauth=0
while [ ${blockauth} -eq 0 ] ; do