From 47de4e7cbac02f51cd340e536988a13859afee91 Mon Sep 17 00:00:00 2001 From: Alex Harpin Date: Sat, 21 Nov 2015 09:58:44 +0000 Subject: vyatta-op: add restart cli command for telnet Add a CLI op mode command to allow restarting of the Telnet service without having to update the configuration. Bug #514 http://bugzilla.vyos.net/show_bug.cgi?id=514 --- templates/restart/telnet/node.def | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 templates/restart/telnet/node.def diff --git a/templates/restart/telnet/node.def b/templates/restart/telnet/node.def new file mode 100644 index 0000000..25c305d --- /dev/null +++ b/templates/restart/telnet/node.def @@ -0,0 +1,14 @@ +help: Restart Telnet service + +run: + if cli-shell-api existsActive service telnet; then + port="$(cli-shell-api returnActiveValue service telnet port)" + listen_address="$(cli-shell-api returnActiveValue service telnet listen-address)" + echo "Restarting Telnet..." + /opt/vyatta/sbin/vyatta_update_telnet enable $port $listen_address + if [[ $? -eq 0 ]]; then + echo "Success!" + fi + else + echo "Telnet is not configured" + fi -- cgit v1.2.3