X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=blobdiff_plain;f=bin%2Fheat;fp=bin%2Fheat;h=8b975391eb35ec5bb622aba81fc39a482c623eaa;hp=2320115118461818bc635f32d8169163ff4f6805;hb=0ec03d8e3b0df03111a64a642a42b89de44a6d8e;hpb=88379d29f08d3f32d564ee3ae39d58cd6482176a 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];