summaryrefslogtreecommitdiffstats
path: root/rpm/init-functions-compat
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:02:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:02:19 +0000
commite308bcff5a610d6a3bbe33b3769f03f6d4533b16 (patch)
tree6a8ed4eb26cd55f3a24165bc1d9b9a1f0ab62e8c /rpm/init-functions-compat
parentInitial commit. (diff)
downloadpostgresql-common-e308bcff5a610d6a3bbe33b3769f03f6d4533b16.tar.xz
postgresql-common-e308bcff5a610d6a3bbe33b3769f03f6d4533b16.zip
Adding upstream version 248.upstream/248upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--rpm/init-functions-compat12
1 files changed, 12 insertions, 0 deletions
diff --git a/rpm/init-functions-compat b/rpm/init-functions-compat
new file mode 100644
index 0000000..da13596
--- /dev/null
+++ b/rpm/init-functions-compat
@@ -0,0 +1,12 @@
+# Functions missing in older /lib/lsb/init-functions scripts
+
+function_exists () {
+ type $1 >/dev/null 2>&1
+}
+
+function_exists log_daemon_msg || log_daemon_msg () { echo -n "$1:${2:+ $2}"; }
+function_exists log_progress_msg || log_progress_msg () { echo -n " $1"; }
+function_exists log_end_msg || log_end_msg () { if [ $1 -eq 0 ]; then echo "."; else echo "failed!"; fi; }
+# this one exists, but we provide it anyway so we don't need to depend on redhat-lsb-core:
+function_exists log_warning_msg || log_warning_msg () { echo "$1"; }
+function_exists log_failure_msg || log_failure_msg () { echo "$1"; }