UNSET_MARK="<<<unset>>>"
RESOLV_OPTIONS="${UNSET_MARK}"
+EXPECTED_PERMS="644"
+
#-------------------------------------------------------------------
detect_color() {
printf "${content}" >"${RESOLV_CONF}"
fi
+ empty_line
+ debug "Ensuring correct permissions to '${CYAN}${RESOLV_CONF}${NORMAL}':"
+ local cur_perms=
+ local verbose_opt=
+ local cmd=
+ if [[ "${VERBOSE}" == "y" ]] ; then
+ verbose_opt=" --verbose"
+ cur_perms=$( stat --printf '%A' "${RESOLV_CONF}" )
+ debug "Current permissions of '${RESOLV_CONF}': ${CYAN}${cur_perms}${NORMAL}"
+ fi
+ cur_perms=$( stat --printf '%a' "${RESOLV_CONF}" )
+ if [[ "${cur_perms}" != "${EXPECTED_PERMS}" ]] ; then
+ cmd="chmod${verbose_opt} '${EXPECTED_PERMS}' '${RESOLV_CONF}'"
+ info "Setting permissions of '${CYAN}${RESOLV_CONF}${NORMAL}' to '${CYAN}${EXPECTED_PERMS}${NORMAL}' ..."
+ if [[ "${SIMULATE}" == "y" ]] ; then
+ info "Simulating executing: ${cmd}"
+ else
+ debug "Executing: ${cmd}"
+ eval ${cmd}
+ fi
+ fi
+
}
#------------------------------------------------------------------------------