summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-07-06 21:32:29 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-07-06 21:32:29 -0700
commit0e5441219e9e3ca70bb11bd91622cd8028141475 (patch)
tree7098c965f80e6b448b41772b3f50bdf5dca9a7d5 /scripts
parent187f457e33f40c4f370700b5dd22d0d2de903450 (diff)
downloadvyatta-op-0e5441219e9e3ca70bb11bd91622cd8028141475.tar.gz
vyatta-op-0e5441219e9e3ca70bb11bd91622cd8028141475.zip
Add show login commands
Bug 5554 Add CLI interface to user state commands (who, id, etc)
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-show-current-user20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/vyatta-show-current-user b/scripts/vyatta-show-current-user
new file mode 100755
index 0000000..87c5543
--- /dev/null
+++ b/scripts/vyatta-show-current-user
@@ -0,0 +1,20 @@
+#! /bin/bash
+#
+# Simple script for "show login"
+
+echo -n "login : " ; who -m
+
+if [ -n "$VYATTA_USER_LEVEL_DIR" ]
+then
+ echo -n "level : "
+ basename $VYATTA_USER_LEVEL_DIR
+fi
+
+echo -n "user : " ; id -un
+echo -n "groups : " ; id -gn
+
+if id -Z >/dev/null 2>&1
+then
+ echo -n "context : "
+ id -Z
+fi