From 14fb822154015dc7944187361153b4fed205730e Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 3 Oct 2022 12:16:31 -0400 Subject: T4726: add completion help and validation for accel-ppp vendor option --- .../accel-ppp/radius-additions-rate-limit.xml.i | 12 ++++++++--- interface-definitions/vpn-l2tp.xml.in | 24 +--------------------- src/validators/accel-radius-dictionary | 13 ++++++++++++ 3 files changed, 23 insertions(+), 26 deletions(-) create mode 100755 src/validators/accel-radius-dictionary diff --git a/interface-definitions/include/accel-ppp/radius-additions-rate-limit.xml.i b/interface-definitions/include/accel-ppp/radius-additions-rate-limit.xml.i index c9ad0d3d4..44ed9465e 100644 --- a/interface-definitions/include/accel-ppp/radius-additions-rate-limit.xml.i +++ b/interface-definitions/include/accel-ppp/radius-additions-rate-limit.xml.i @@ -6,18 +6,24 @@ - Specifies which RADIUS attribute contains rate information. (default is Filter-Id) + RADIUS attribute that contains rate information. (default: Filter-Id) Filter-Id - Specifies the vendor dictionary. (dictionary needs to be in /usr/share/accel-ppp/radius) + Vendor dictionary + + alcatel cisco microsoft mikrotik + + + + - Enables Bandwidth shaping via RADIUS + Enable bandwidth shaping via RADIUS diff --git a/interface-definitions/vpn-l2tp.xml.in b/interface-definitions/vpn-l2tp.xml.in index fd70a76dc..cb5900e0d 100644 --- a/interface-definitions/vpn-l2tp.xml.in +++ b/interface-definitions/vpn-l2tp.xml.in @@ -238,29 +238,7 @@ - - - Upload/Download speed limits - - - - - Specifies which radius attribute contains rate information - - - - - Specifies the vendor dictionary. (dictionary needs to be in /usr/share/accel-ppp/radius) - - - - - Enables Bandwidth shaping via RADIUS - - - - - + #include diff --git a/src/validators/accel-radius-dictionary b/src/validators/accel-radius-dictionary new file mode 100755 index 000000000..05287e770 --- /dev/null +++ b/src/validators/accel-radius-dictionary @@ -0,0 +1,13 @@ +#!/bin/sh + +DICT_PATH=/usr/share/accel-ppp/radius +NAME=$1 + +if [ -n "$NAME" -a -e $DICT_PATH/dictionary.$NAME ]; then + exit 0 +else + echo "$NAME is not a valid RADIUS dictionary name" + echo "Please make sure that $DICT_PATH/dictionary.$NAME file exists" + exit 1 +fi + -- cgit v1.2.3