Hello,
I implemented a update system rule but I always get this issue.
2021-07-15 12:57:59.915 [INFO ] [t.execute string_flag_System upgrade] - upgrading openHAB
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
sudo: no tty present and no askpass program specified
here is my item:
String string_flag_System "System" <switch>
and my rule
rule "execute string_flag_System upgrade"
when
Item string_flag_System received command "Upgrade"
then
try {
logInfo("execute string_flag_System upgrade", "upgrading off openHAB")
var ScriptResponse = executeCommandLine(Duration.ofSeconds(60), "sudo","apt-get update && apt-get upgrade")
logInfo("execute string_flag_System upgrade", "upgrading openHAB " + ScriptResponse.toString() )
//executeCommandLine("sudo","apt-get update")
//executeCommandLine("sudo","apt-get upgrade")
string_flag_System.postUpdate(NULL)
}
catch(Throwable T)
{
logError("Error", "Some bad stuff happened in \"execute string_flag_System upgrade\": " + T.toString)
}
finally
{
}
end
this is my visudo file
openhab ALL=NOPASSWD: /usr/bin/apt-get upgrade, /usr/bin/apt-get update
Where is my error??