aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Rousse <guillomovitch@mandriva.org>2007-03-05 16:15:36 +0000
committerGuillaume Rousse <guillomovitch@mandriva.org>2007-03-05 16:15:36 +0000
commit8e31ce86b369f954220ad9bdf0f2ebe80b3cf00b (patch)
tree1d2af353426d486b7809ba6bfb845791d641bb2f
parent6336da1d5ac6560ca08d5a6962815581a1c4bd29 (diff)
downloadrpm-helper-8e31ce86b369f954220ad9bdf0f2ebe80b3cf00b.tar
rpm-helper-8e31ce86b369f954220ad9bdf0f2ebe80b3cf00b.tar.gz
rpm-helper-8e31ce86b369f954220ad9bdf0f2ebe80b3cf00b.tar.bz2
rpm-helper-8e31ce86b369f954220ad9bdf0f2ebe80b3cf00b.tar.xz
rpm-helper-8e31ce86b369f954220ad9bdf0f2ebe80b3cf00b.zip
only scan local facilities from 0 to 7 (fix #29141)
-rwxr-xr-xget-free-syslog-facility9
1 files changed, 5 insertions, 4 deletions
diff --git a/get-free-syslog-facility b/get-free-syslog-facility
index 8524844..192e0e4 100755
--- a/get-free-syslog-facility
+++ b/get-free-syslog-facility
@@ -3,9 +3,10 @@
# 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));
+ for (( i=0; i <= 7; i++ )); do
+ if ! grep -q "local$i" /etc/syslog.conf; then
+ echo "local$i"
+ break
+ fi
done
- echo local${cntlog}
fi