diff options
Diffstat (limited to 'templates')
4 files changed, 28 insertions, 4 deletions
diff --git a/templates/clone/system/config/node.tag/from/node.tag/node.def b/templates/clone/system/config/node.tag/from/node.tag/node.def index d099dc8..42ef94e 100644 --- a/templates/clone/system/config/node.tag/from/node.tag/node.def +++ b/templates/clone/system/config/node.tag/from/node.tag/node.def @@ -7,4 +7,10 @@ allowed: reply=( $(compgen -f /live/image/boot/ | grep -v grub) ) done reply+=( "running://" ) echo "${reply[*]}" -run: sudo ${vyatta_sbindir}/vyatta-image-tools.pl --update $4 $6 +run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; + then + sudo ${vyatta_sbindir}/vyatta-image-tools.pl --update $4 $6 + else + echo Must be an admin user to run this command. + fi + diff --git a/templates/clone/system/config/node.tag/node.def b/templates/clone/system/config/node.tag/node.def index 415b665..d54a4cf 100644 --- a/templates/clone/system/config/node.tag/node.def +++ b/templates/clone/system/config/node.tag/node.def @@ -7,4 +7,10 @@ allowed: reply=( $(compgen -f /live/image/boot/ | grep -v grub) ) done reply+=( "running://" ) echo "${reply[*]}" -run: sudo ${vyatta_sbindir}/vyatta-image-tools.pl --updateone $4 +run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; + then + sudo ${vyatta_sbindir}/vyatta-image-tools.pl --updateone $4 + else + echo Must be an admin user to run this command. + fi + diff --git a/templates/copy/file/node.tag/to/node.tag/node.def b/templates/copy/file/node.tag/to/node.tag/node.def index 75d4aff..0f03a23 100644 --- a/templates/copy/file/node.tag/to/node.tag/node.def +++ b/templates/copy/file/node.tag/to/node.tag/node.def @@ -4,4 +4,10 @@ help: Copy files to specified destination tftp://<host>/<file> comptype: imagefiles allowed: echo -n "<imagefiles>" -run: sudo ${vyatta_sbindir}/vyatta-image-tools.pl --copy $3 $5 +run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; + then + sudo ${vyatta_sbindir}/vyatta-image-tools.pl --copy $3 $5 + else + echo Must be an admin user to run this command. + fi + diff --git a/templates/delete/file/node.tag/node.def b/templates/delete/file/node.tag/node.def index 715ba48..0faf383 100644 --- a/templates/delete/file/node.tag/node.def +++ b/templates/delete/file/node.tag/node.def @@ -1,4 +1,10 @@ help: Delete files in the specified directory comptype: imagefiles allowed: echo -n "<imagefiles>" -run: sudo ${vyatta_sbindir}/vyatta-image-tools.pl --delete=$3 +run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; + then + sudo ${vyatta_sbindir}/vyatta-image-tools.pl --delete=$3 + else + echo Must be an admin user to run this command. + fi + |