aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Rousse <guillomovitch@mandriva.org>2007-02-15 15:26:55 +0000
committerGuillaume Rousse <guillomovitch@mandriva.org>2007-02-15 15:26:55 +0000
commit78f657e1f5910b8778f7d9198e726068139ac928 (patch)
tree0469d74e7c612ccfa541177fcb3bda4f08983b6b
parent48cd5ad23955ae2ec25a4d5b9d94f4292ae130bc (diff)
downloadrpm-helper-78f657e1f5910b8778f7d9198e726068139ac928.tar
rpm-helper-78f657e1f5910b8778f7d9198e726068139ac928.tar.gz
rpm-helper-78f657e1f5910b8778f7d9198e726068139ac928.tar.bz2
rpm-helper-78f657e1f5910b8778f7d9198e726068139ac928.tar.xz
rpm-helper-78f657e1f5910b8778f7d9198e726068139ac928.zip
get free syslog facility helper
-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}