git://git.jankratochvil.net
/
nethome.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bin/heat: Protect changes to !s against running dnf.
[nethome.git]
/
bin
/
heat
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;
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];
my $both={"s"=>[0,0],"0"=>[1,0],"1"=>[1,1]}->{$newstate};
spawn "$usbrelay 1 ".$both->[0];
spawn "$usbrelay 2 ".$both->[1];