mirror of
https://github.com/trimstray/the-book-of-secret-knowledge.git
synced 2024-10-01 01:26:00 -04:00
Merge pull request #39 from lbonanomi/master
Test if the current user is sudo-su'd into this session
This commit is contained in:
commit
aa2adcbee2
@ -1236,6 +1236,12 @@ ___
|
|||||||
who -b
|
who -b
|
||||||
```
|
```
|
||||||
|
|
||||||
|
###### Detect a user sudo-su'd into the current shell
|
||||||
|
|
||||||
|
```bash
|
||||||
|
[[ $(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