[skip ci] fix: root does not need sudo

This commit is contained in:
az 2021-11-29 14:39:22 +01:00
parent fc625a8124
commit 403c442a96

View file

@ -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.")
} }
} }