From 3fdbde8ca0342f8cc2f744f25a7e9491577abedb Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 4 Jun 2020 16:09:44 +0200 Subject: op-mode: T2546: add "show login" commands --- src/op_mode/show_current_user.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 src/op_mode/show_current_user.sh (limited to 'src') 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 -- cgit v1.2.3