aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2019-12-03 11:41:18 +0100
committerGravatar Christian Hesse <mail@eworm.de>2019-12-03 11:41:18 +0100
commite37af0065c9e52243ea83780c73029b0ec8acf1c (patch)
tree406e3735597290cf68c9a0384019f00067fae4c4
parentac6c132ea0154de90b4f8f9f8366eab7db86abc8 (diff)
hotspot-to-wpa: get limits from place-before-entry
-rw-r--r--hotspot-to-wpa13
1 files changed, 11 insertions, 2 deletions
diff --git a/hotspot-to-wpa b/hotspot-to-wpa
index d1e7cee..bf5ce81 100644
--- a/hotspot-to-wpa
+++ b/hotspot-to-wpa
@@ -16,5 +16,14 @@
}
/ caps-man access-list remove [ find where mac-address=$MacAddress comment~"^hotspot-to-wpa: " ];
-/ caps-man access-list add comment=("hotspot-to-wpa: " . $UserName . ", " . $MacAddress . ", " . $Date) \
- mac-address=$MacAddress private-passphrase=$PassWord ssid-regexp="-wpa\$" place-before=$PlaceBefore;
+
+:local Limits [ / caps-man access-list get $PlaceBefore ];
+:if (($Limits->"ap-tx-limit") > 0 && ($Limits->"client-tx-limit") > 0) do={
+ / caps-man access-list add comment=("hotspot-to-wpa: " . $UserName . ", " . $MacAddress . ", " . $Date) \
+ mac-address=$MacAddress private-passphrase=$PassWord ssid-regexp="-wpa\$" \
+ ap-tx-limit=($Limits->"ap-tx-limit") client-tx-limit=($Limits->"client-tx-limit") \
+ place-before=$PlaceBefore;
+} else={
+ / caps-man access-list add comment=("hotspot-to-wpa: " . $UserName . ", " . $MacAddress . ", " . $Date) \
+ mac-address=$MacAddress private-passphrase=$PassWord ssid-regexp="-wpa\$" place-before=$PlaceBefore;
+}