summaryrefslogtreecommitdiff
path: root/templates/show/configuration
diff options
context:
space:
mode:
Diffstat (limited to 'templates/show/configuration')
-rw-r--r--templates/show/configuration/all/node.def7
-rw-r--r--templates/show/configuration/cmds/node.def7
-rw-r--r--templates/show/configuration/files/node.def7
-rw-r--r--templates/show/configuration/node.def7
4 files changed, 24 insertions, 4 deletions
diff --git a/templates/show/configuration/all/node.def b/templates/show/configuration/all/node.def
index 12431ce..77c3e04 100644
--- a/templates/show/configuration/all/node.def
+++ b/templates/show/configuration/all/node.def
@@ -1,2 +1,7 @@
help: Show running configuration (including default values)
-run: ${vyatta_sbindir}/vyatta-output-config.pl -all -active
+run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ];
+ then
+ ${vyatta_sbindir}/vyatta-output-config.pl -all -active
+ else
+ echo Must be an admin user to run this command.
+ fi
diff --git a/templates/show/configuration/cmds/node.def b/templates/show/configuration/cmds/node.def
index 03f9f4c..a2d55cf 100644
--- a/templates/show/configuration/cmds/node.def
+++ b/templates/show/configuration/cmds/node.def
@@ -1,2 +1,7 @@
help: Show running configuration as set commands
-run: ${vyatta_sbindir}/vyatta-config-gen-sets.pl
+run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ];
+ then
+ ${vyatta_sbindir}/vyatta-config-gen-sets.pl
+ else
+ echo Must be an admin user to run this command.
+ fi
diff --git a/templates/show/configuration/files/node.def b/templates/show/configuration/files/node.def
index b13bc6d..698ba14 100644
--- a/templates/show/configuration/files/node.def
+++ b/templates/show/configuration/files/node.def
@@ -1,5 +1,10 @@
help: Show available saved configurations
-run: find ${vyatta_sysconfdir}/config/ -type f -not -name ".*" -not -name "config.boot.*" -printf "%f\t(%Tc)\t%T@\n" | sort -r -k3 | awk -F"\t" '{printf ("%-20s\t%s\n", $1,$2) ;}'
+run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ];
+ then
+ find ${vyatta_sysconfdir}/config/ -type f -not -name ".*" -not -name "config.boot.*" -printf "%f\t(%Tc)\t%T@\n" | sort -r -k3 | awk -F"\t" '{printf ("%-20s\t%s\n", $1,$2) ;}'
+ else
+ echo Must be an admin user to run this command.
+ fi
diff --git a/templates/show/configuration/node.def b/templates/show/configuration/node.def
index d3a36e0..3c2c7e7 100644
--- a/templates/show/configuration/node.def
+++ b/templates/show/configuration/node.def
@@ -1,2 +1,7 @@
help: Show running configuration
-run: ${vyatta_sbindir}/vyatta-output-config.pl -active
+run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ];
+ then
+ ${vyatta_sbindir}/vyatta-output-config.pl -active
+ else
+ echo Must be an admin user to run this command.
+ fi