summaryrefslogtreecommitdiff
path: root/src/op_mode
diff options
context:
space:
mode:
Diffstat (limited to 'src/op_mode')
-rwxr-xr-xsrc/op_mode/show_current_user.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/op_mode/show_current_user.sh b/src/op_mode/show_current_user.sh
new file mode 100755
index 000000000..93e6efa61
--- /dev/null
+++ b/src/op_mode/show_current_user.sh
@@ -0,0 +1,18 @@
+#! /bin/bash
+
+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