git://git.jankratochvil.net
/
nethome.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
88379d2
)
bin/heat: Protect changes to !s against running dnf.
author
Jan Kratochvil
<jan@jankratochvil.net>
Fri, 21 Jan 2022 08:16:43 +0000
(09:16 +0100)
committer
Jan Kratochvil
<jan@jankratochvil.net>
Fri, 21 Jan 2022 08:16:43 +0000
(09:16 +0100)
bin/heat
patch
|
blob
|
history
diff --git
a/bin/heat
b/bin/heat
index
2320115
..
8b97539
100755
(executable)
--- 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];