summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/restart/telnet/node.def14
1 files changed, 14 insertions, 0 deletions
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