#!/bin/bash

INF_FILE="test.inf"

var_name=""
while IFS= read -r s ; do
    echo "[${s}]"
    if echo "${s}" | grep -E '^[^[:space:]]+:[[:space:]]*.*$' > /dev/null 2>&1 ; then
        var_name=$( echo "${s}" | sed -re 's|^([^[:space:]]+):[[:space:]]*.*$|\1|' )
        var_val=$(  echo "${s}" | sed -re 's|^[^[:space:]]+:[[:space:]]*(.*)$|\1|' )
        if [ -z "$( eval echo \"\${${var_name}}\" )" ] ; then
            eval ${var_name}="${var_val}"
        fi
        echo "VAR found: ${var_name} -> [${var_val}]"
    fi
    echo "${s}" | grep -E '^[[:space:]]+.*$' > /dev/null 2>&1 && echo "Continuation found"
done < "${INF_FILE}"
