summaryrefslogtreecommitdiff
path: root/op-mode-definitions
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-14 20:59:03 +0200
committerGitHub <noreply@github.com>2020-04-14 20:59:03 +0200
commit9bcfdc20ade97b2d746bbe1b8506524aae710ca2 (patch)
tree5796a09f5f06e7c9737a356792a3cd900a4aa391 /op-mode-definitions
parent8019881c599a3ae93ca859856f3b700ff4aeeb6f (diff)
parent603d47d5e2cfc9b72a6de689136231115a3e0d6f (diff)
downloadvyos-1x-9bcfdc20ade97b2d746bbe1b8506524aae710ca2.tar.gz
vyos-1x-9bcfdc20ade97b2d746bbe1b8506524aae710ca2.zip
Merge pull request #344 from DmitriyEshenko/ipoe-op
ipoe: T2256: Rewrite op-mode commands
Diffstat (limited to 'op-mode-definitions')
-rw-r--r--op-mode-definitions/ipoe-server.xml33
1 files changed, 21 insertions, 12 deletions
diff --git a/op-mode-definitions/ipoe-server.xml b/op-mode-definitions/ipoe-server.xml
index c05e2d2c1..c20d3aa2a 100644
--- a/op-mode-definitions/ipoe-server.xml
+++ b/op-mode-definitions/ipoe-server.xml
@@ -12,24 +12,33 @@
<help>Clear ipoe-server session</help>
</properties>
<children>
- <leafNode name="username">
+ <tagNode name="username">
<properties>
<help>Clear ipoe-server session by username</help>
<completionHelp>
- <script>/usr/bin/accel-cmd -p 2002 show sessions username | sed -e 's/ \r//g' | tail -n +3</script>
+ <script>${vyos_completion_dir}/list_ipoe.py --selector="username"</script>
</completionHelp>
</properties>
- <command>/usr/bin/accel-cmd -p 2002 terminate username $5</command>
- </leafNode>
- <leafNode name="sid">
+ <command>${vyos_op_scripts_dir}/ipoe-control.py --action="terminate" --selector="username" --target="$5"</command>
+ </tagNode>
+ <tagNode name="sid">
<properties>
- <help>Clear ipoe-server session by sid</help>
+ <help>Clear ipoe-server session by Session ID</help>
<completionHelp>
- <script>/usr/bin/accel-cmd -p 2002 show sessions sid | sed -e 's/ \r//g' | tail -n +3</script>
+ <script>${vyos_completion_dir}/list_ipoe.py --selector="sid"</script>
</completionHelp>
</properties>
- <command>/usr/bin/accel-cmd -p 2002 terminate sid $5</command>
- </leafNode>
+ <command>${vyos_op_scripts_dir}/ipoe-control.py --action="terminate" --selector="sid" --target="$5"</command>
+ </tagNode>
+ <tagNode name="interface">
+ <properties>
+ <help>Clear ipoe-server session by interface</help>
+ <completionHelp>
+ <script>${vyos_completion_dir}/list_ipoe.py --selector="ifname"</script>
+ </completionHelp>
+ </properties>
+ <command>${vyos_op_scripts_dir}/ipoe-control.py --action="terminate" --selector="if" --target="$5"</command>
+ </tagNode>
</children>
</node>
</children>
@@ -47,13 +56,13 @@
<properties>
<help>Show active IPoE server sessions</help>
</properties>
- <command>/usr/bin/accel-cmd -p 2002 show sessions ifname,username,called-sid,calling-sid,ip,ip6,ip6-dp,rate-limit,state,uptime,sid</command>
+ <command>${vyos_op_scripts_dir}/ipoe-control.py --action="show_sessions"</command>
</leafNode>
<leafNode name="statistics">
<properties>
<help>Show IPoE server statistics</help>
</properties>
- <command>/usr/bin/accel-cmd -p 2002 show stat</command>
+ <command>${vyos_op_scripts_dir}/ipoe-control.py --action="show_stat"</command>
</leafNode>
</children>
</node>
@@ -65,7 +74,7 @@
<properties>
<help>show ipoe-server status</help>
</properties>
- <command>if [ -e /var/run/accel_ipoe.pid ]; then /usr/bin/accel-cmd restart -p 2002; else echo "ipoe-server not running"; fi</command>
+ <command>${vyos_op_scripts_dir}/ipoe-control.py --action="restart"</command>
</leafNode>
</children>
</node>