From 8d48f4ca5e54161474987a9fab80736fe6268913 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sat, 25 Mar 2017 14:05:13 +0100 Subject: [PATCH] =?UTF-8?q?=C3=BCberpr=C3=BCfe,=20ob=20root=20ausf=C3=BChr?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dyn_announce_gw_bw_with-max-client-leases.sh | 2 +- fff-list_dhcp_leases.sh | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dyn_announce_gw_bw_with-max-client-leases.sh b/dyn_announce_gw_bw_with-max-client-leases.sh index f88ea12..f3e9671 100755 --- a/dyn_announce_gw_bw_with-max-client-leases.sh +++ b/dyn_announce_gw_bw_with-max-client-leases.sh @@ -40,7 +40,7 @@ do # Erlangen schalten wir die Gatewayselection zur Sicherheit bei 450 leases ab, damit noch etwas Puffer nach oben ist! leasecount=$(/usr/sbin/dhcp-lease-list --parsable --lease /var/lib/dhcp/dhcpd.leases 2>&1 | grep "10.50.100" | wc -l) - if [ $leasecount -gt 250 ] + if [ $leasecount -gt 450 ] then batctl -m bat0 gw_mode off fi diff --git a/fff-list_dhcp_leases.sh b/fff-list_dhcp_leases.sh index 7a33c41..c5f59a5 100755 --- a/fff-list_dhcp_leases.sh +++ b/fff-list_dhcp_leases.sh @@ -1,3 +1,10 @@ #!/bin/bash -dhcp-lease-list --lease /var/lib/dhcp/dhcpd.leases +if [ ! `id -u` = 0 ] +then + echo "you are not root" + exit 1 +else + dhcp-lease-list --lease /var/lib/dhcp/dhcpd.leases +fi +