linux的shell脚本,怎么读取外部配置文件呢?

我有一个需求,需要编写一个脚本,通过判断当前机器的ip,更具ip做出不同的行为,我想把ip地址分类配置到一个配置文件里面,读取配置文件,然后和当前ip地址做对比,然后执行不同的动作


get_value_of_properties_file() {
  result=""
  proFilePath="$1"
  key="$2"
    if [ "WJA${key}" = "WJA" ]; then
    echo "参数错误,未能指定有效Key。"
    echo "" >&2
    exit 1
  fi
  if [ ! -f ${proFilePath} ]; then
    echo "属性文件(${proFilePath})不存在。"
    echo "" >&2
    exit 1
  fi
  if [ ! -r ${proFilePath} ]; then
    echo "当前用户不具有对属性文件(${proFilePath})的可读权限。"
    echo "" >&2
    exit 1
  fi
  keyLength=$(echo ${key}|wc -L)
  lineNumStr=$(cat ${proFilePath} | wc -l)
  lineNum=$((${lineNumStr}))
  for ((i = 1; i <= ${lineNum}; i++)); do
    oneLine=$(sed -n ${i}p ${proFilePath})
    if [ "${oneLine:0:((keyLength))}" = "${key}" ] && [ "${oneLine:$((keyLength)):1}" = "=" ]; then
      result=${oneLine#*=}
      break
    fi
  done
  echo ${result}
}

用其他语言写吧,java,C#都行,脚本毕竟只是脚本,有很多限制。