[skip ci] fix: root does not need sudo
This commit is contained in:
parent
fc625a8124
commit
403c442a96
1 changed files with 1 additions and 1 deletions
|
@ -18,7 +18,7 @@ class UbuntuProv internal constructor(
|
||||||
|
|
||||||
init {
|
init {
|
||||||
val user = cmdNoLog("whoami").out?.trim()
|
val user = cmdNoLog("whoami").out?.trim()
|
||||||
if (!cmdNoLog("timeout 1 sudo id").success) {
|
if ("root" != user && !cmdNoLog("timeout 1 sudo id").success) {
|
||||||
println("!!!!!!!!!! WARNING !!!!!!!!!!\nUser $user cannot sudo without entering a password, i.e. most functions may fail!\nPlease ensure $user can sudo without password.")
|
println("!!!!!!!!!! WARNING !!!!!!!!!!\nUser $user cannot sudo without entering a password, i.e. most functions may fail!\nPlease ensure $user can sudo without password.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue