diff options
author | DmitriyEshenko <dmitriy.eshenko@vyos.io> | 2020-04-14 18:42:54 +0000 |
---|---|---|
committer | DmitriyEshenko <dmitriy.eshenko@vyos.io> | 2020-04-14 18:42:54 +0000 |
commit | 603d47d5e2cfc9b72a6de689136231115a3e0d6f (patch) | |
tree | 449ec0c75960c87dadb6a41885c47a1b39c24904 /op-mode-definitions | |
parent | c27f13ab459ef5116eeac417d256abfabf2690c2 (diff) | |
download | vyos-1x-603d47d5e2cfc9b72a6de689136231115a3e0d6f.tar.gz vyos-1x-603d47d5e2cfc9b72a6de689136231115a3e0d6f.zip |
ipoe: T2256: Rewrite op-mode commands
Diffstat (limited to 'op-mode-definitions')
-rw-r--r-- | op-mode-definitions/ipoe-server.xml | 33 |
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> |