diff options
Diffstat (limited to 'share/postgresql-setup/library.sh.in')
-rw-r--r-- | share/postgresql-setup/library.sh.in | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/share/postgresql-setup/library.sh.in b/share/postgresql-setup/library.sh.in index 32c8036..fe38f6c 100644 --- a/share/postgresql-setup/library.sh.in +++ b/share/postgresql-setup/library.sh.in @@ -1,3 +1,25 @@ +die() { echo >&2 $"FATAL: $@" ; exit 1 ; } +error() { echo >&2 $"ERROR: $@" ; } +error_q() { echo >&2 $" $@" ; } +warn() { echo >&2 $"WARNING: $@" ; } +warn_q() { echo >&2 $" $@" ; } +info() { echo >&2 $" * $@" ; } +info_q() { echo >&2 $" $@" ; } +debug() { test "$option_debug" = "1" && echo >&2 $"DEBUG: $@"; } + + +set_var() +{ + eval "$1=\"$2\"" +} + + +root_prereq() +{ + test "$(id -u)" -eq 0 || die "$0 requires root access for this action" +} + + read_config_file() { local key="" val="" |