2022-02-21 10:56:57 +00:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
function _escape
|
|
|
|
{
|
|
|
|
echo "${1//./\\.}"
|
|
|
|
}
|
|
|
|
|
2022-06-05 23:02:52 +00:00
|
|
|
# Returns input after filtering out lines that are:
|
|
|
|
# empty, white-space, comments (`#` as the first non-whitespace character)
|
2022-06-06 13:07:30 +00:00
|
|
|
function _get_valid_lines_from_file
|
2022-06-05 23:02:52 +00:00
|
|
|
{
|
|
|
|
grep --extended-regexp --invert-match "^\s*$|^\s*#" "${1}" || true
|
|
|
|
}
|
|
|
|
|
2022-04-05 15:10:01 +00:00
|
|
|
# Provide the name of an environment variable to this function
|
|
|
|
# and it will return its value stored in /etc/dms-settings
|
|
|
|
function _get_dms_env_value
|
|
|
|
{
|
|
|
|
local VALUE
|
|
|
|
VALUE=$(grep "^${1}=" /etc/dms-settings | cut -d '=' -f 2)
|
|
|
|
printf '%s' "${VALUE:1:-1}"
|
|
|
|
}
|