aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xget-free-syslog-facility11
-rw-r--r--rpm-helper.macros.in4
2 files changed, 15 insertions, 0 deletions
diff --git a/get-free-syslog-facility b/get-free-syslog-facility
new file mode 100755
index 0000000..8524844
--- /dev/null
+++ b/get-free-syslog-facility
@@ -0,0 +1,11 @@
+#!/bin/sh
+# $Id$
+# helper script for rpm scriptlets to get a free syslog local facility
+
+if [ -f /etc/syslog.conf ]; then
+ cntlog=0
+ while grep -q local${cntlog} /etc/syslog.conf; do
+ cntlog=$((cntlog+1));
+ done
+ echo local${cntlog}
+fi
diff --git a/rpm-helper.macros.in b/rpm-helper.macros.in
index 37e7d7e..7823d68 100644
--- a/rpm-helper.macros.in
+++ b/rpm-helper.macros.in
@@ -4,6 +4,10 @@
%get_password() %_get_password_helper %{1} \
%{nil}
+%_get_free_syslog_facility_helper @LIBDIR@/get_free_syslog_facility
+%get_free_syslog_facility() %_get_free_syslog_facility_helper %{1} \
+%{nil}
+
%_create_ghostfile_helper @LIBDIR@/create-file
%create_ghostfile() %_create_ghostfile_helper %{name} $1 %{1} %{2} %{3} %{4} \
%{nil}