test if the current user is sudo-su'd into this session
- signed-off-by: lbonanomi <lbonanomi@gmail.com>
This commit is contained in:
parent
f42515078a
commit
985714befd
@ -1227,6 +1227,12 @@ ___
|
|||||||
who -b
|
who -b
|
||||||
```
|
```
|
||||||
|
|
||||||
|
###### Detect a user sudo-su'd into the current shell
|
||||||
|
|
||||||
|
```
|
||||||
|
[[ $(who -m | awk '{ print $1 }') == $(whoami) ]] || echo "You are su-ed to $(whoami)"
|
||||||
|
```
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
##### Tool: [screen](https://en.wikipedia.org/wiki/GNU_Screen)
|
##### Tool: [screen](https://en.wikipedia.org/wiki/GNU_Screen)
|
||||||
|
Loading…
Reference in New Issue
Block a user