diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-06-04 16:09:44 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-06-04 16:10:32 +0200 |
commit | 3fdbde8ca0342f8cc2f744f25a7e9491577abedb (patch) | |
tree | 178b010b049955abb40919f92e1d571fc1da4210 /src/op_mode/show_current_user.sh | |
parent | b2d98015b152528ee5ef81ddafa5d03ab059f883 (diff) | |
download | vyos-1x-3fdbde8ca0342f8cc2f744f25a7e9491577abedb.tar.gz vyos-1x-3fdbde8ca0342f8cc2f744f25a7e9491577abedb.zip |
op-mode: T2546: add "show login" commands
Diffstat (limited to 'src/op_mode/show_current_user.sh')
-rwxr-xr-x | src/op_mode/show_current_user.sh | 18 |
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 |