aboutsummaryrefslogtreecommitdiffstats
path: root/get-free-syslog-facility
diff options
context:
space:
mode:
Diffstat (limited to 'get-free-syslog-facility')
-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