Add kickstart.user.root?
This commit is contained in:
parent
5bdabf6556
commit
9ee05e6933
@ -43,3 +43,4 @@
|
||||
* [kickstart.user.exec](kickstart/user/exec)
|
||||
* [kickstart.user.is_on_group](kickstart/user/is_on_group)
|
||||
* [kickstart.user.remove_group](kickstart/user/remove_group)
|
||||
* [kickstart.user.root?](kickstart/user/root?)
|
||||
|
13
docs/kickstart/user/root?.md
Normal file
13
docs/kickstart/user/root?.md
Normal file
@ -0,0 +1,13 @@
|
||||
# kickstart.user.root?
|
||||
|
||||
Return 0 if the user running is root and 1 if not.
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```bash
|
||||
$ whoami
|
||||
root
|
||||
$ kickstart.user.root? && echo yup
|
||||
yup
|
||||
```
|
@ -47,3 +47,7 @@ kickstart.user.exec() {
|
||||
kickstart.info Running \'"$@"\' as $user
|
||||
su $user - bash -c "$command"
|
||||
}
|
||||
|
||||
kickstart.user.root?() {
|
||||
[ `whoami` == root ]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user