From 0ec03d8e3b0df03111a64a642a42b89de44a6d8e Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 21 Jan 2022 09:16:43 +0100 Subject: [PATCH] bin/heat: Protect changes to !s against running dnf. --- bin/heat | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/heat b/bin/heat index 2320115..8b97539 100755 --- a/bin/heat +++ b/bin/heat @@ -145,6 +145,10 @@ sub setstate() { info "->$newstate"; writefile $statefile,"$newstate\n" if $state ne $newstate; logmsg "$state->$newstate" if $state ne $newstate; + if ($newstate ne "s") { + my $pid=readfile "pidof -x dnf;true|"; + die "\nchange refused: dnf running: $pid" if $pid; + } my $both={"s"=>[0,0],"0"=>[1,0],"1"=>[1,1]}->{$newstate}; spawn "$usbrelay 1 ".$both->[0]; spawn "$usbrelay 2 ".$both->[1]; -- 1.8.3.1