From 403c442a963a12dbde017da8148d5c49c5af6b82 Mon Sep 17 00:00:00 2001 From: az Date: Mon, 29 Nov 2021 14:39:22 +0100 Subject: [PATCH] [skip ci] fix: root does not need sudo --- .../domaindrivenarchitecture/provs/core/platforms/UbuntuProv.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/core/platforms/UbuntuProv.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/core/platforms/UbuntuProv.kt index b892135..160ec1d 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/core/platforms/UbuntuProv.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/core/platforms/UbuntuProv.kt @@ -18,7 +18,7 @@ class UbuntuProv internal constructor( init { 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.") } }