pg_hba.conf requires CIDR notation, so just use 192.168.1.1/32 (/32 = 1 address in CIDR).
Pro Tip:
HOSTIP="$(ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')" cat << EOF >>/etc/postgresql/*/main/pg_hba.conf host all all $HOSTIP/32 md5 EOF cat /etc/postgresql/*/main/pg_hba.conf