BASE_DIR=$( dirname "${BIN_DIR}" )
LIB_DIR="${BASE_DIR}/lib"
CONF_DIR="${BASE_DIR}/etc"
+DNS_DIR="${BASE_DIR}/dns"
if [[ -f "${LIB_DIR}/functions.rc" ]] ; then
. "${LIB_DIR}/functions.rc"
info "Checking preferences ..."
local all_ok="y"
+ local rfile=
+ local file_ok="y"
+ local sample_file=
debug "Checking for openfortivpn ..."
if type -p openfortivpn >/dev/null ; then
error "Did not found openfortivpn. Maybe not installed?"
fi
+ for rfile in "${RESOLV_CONF_DPX}" "${RESOLV_CONF_NON_DPX}" ; do
+ debug "Checking '${CYAN}${rfile}${NORMAL}' ..."
+ file_ok="y"
+ if [[ ! -e "${rfile}" ]] ; then
+ error "File '${RED}${rfile}${NORMAL}' does not exists."
+ file_ok="n"
+ elif [[ ! -r "${rfile}" ]] ; then
+ error "File '${RED}${rfile}${NORMAL}' exists, but is not a regular file."
+ file_ok="n"
+ elif [[ ! -s "${rfile}" ]] ; then
+ error "File '${RED}${rfile}${NORMAL}' exists, but is emty."
+ file_ok="n"
+ fi
+ if [[ "${file_ok}" != 'y' ]] ; then
+ sample_file="${DNS_DIR}/$( basename "${rfile}" )"
+ warn "You may copy '${CYAN}${sample_file}${NORMAL}' to '${CYAN}${rfile}${NORMAL}' and modify it for your needs."
+ all_ok="n"
+ fi
+ done
+
if [[ "${all_ok}" != "y" ]] ; then
exit 5
fi