summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/restart/ntp/node.def12
-rw-r--r--templates/restart/snmp/node.def12
-rw-r--r--templates/restart/ssh/node.def12
-rw-r--r--templates/restart/telnet/node.def14
-rw-r--r--templates/show/version/funny/node.def5
5 files changed, 55 insertions, 0 deletions
diff --git a/templates/restart/ntp/node.def b/templates/restart/ntp/node.def
new file mode 100644
index 0000000..d94bb8e
--- /dev/null
+++ b/templates/restart/ntp/node.def
@@ -0,0 +1,12 @@
+help: Restart NTP service
+
+run:
+ if cli-shell-api existsActive system ntp server; then
+ echo "Restarting NTP server..."
+ sudo /usr/sbin/invoke-rc.d ntp force-reload
+ if [[ $? -eq 0 ]]; then
+ echo "Success!"
+ fi
+ else
+ echo "NTP server is not configured"
+ fi
diff --git a/templates/restart/snmp/node.def b/templates/restart/snmp/node.def
new file mode 100644
index 0000000..689b035
--- /dev/null
+++ b/templates/restart/snmp/node.def
@@ -0,0 +1,12 @@
+help: Restart SNMP service
+
+run:
+ if cli-shell-api existsActive service snmp; then
+ echo "Restarting SNMP..."
+ sudo /opt/vyatta/sbin/vyatta-snmp.pl --restart-snmp;
+ if [[ $? -eq 0 ]]; then
+ echo "Success!"
+ fi
+ else
+ echo "SNMP is not configured"
+ fi
diff --git a/templates/restart/ssh/node.def b/templates/restart/ssh/node.def
new file mode 100644
index 0000000..1fa1aff
--- /dev/null
+++ b/templates/restart/ssh/node.def
@@ -0,0 +1,12 @@
+help: Restart SSH service
+
+run:
+ if cli-shell-api existsActive service ssh; then
+ echo "Restarting SSH..."
+ sudo /usr/sbin/invoke-rc.d ssh restart
+ if [[ $? -eq 0 ]]; then
+ echo "Success!"
+ fi
+ else
+ echo "SSH is not configured"
+ fi
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
diff --git a/templates/show/version/funny/node.def b/templates/show/version/funny/node.def
new file mode 100644
index 0000000..cb62c96
--- /dev/null
+++ b/templates/show/version/funny/node.def
@@ -0,0 +1,5 @@
+help: Show VyOS version information plus a funny poem
+run:
+ ${vyatta_bindir}/vyatta-show-version
+ ${vyatta_bindir}/limericks.py
+