blink: multiple devices work.
This commit is contained in:
parent
cb859bb5d5
commit
453802d183
12
blink/blink
12
blink/blink
|
@ -206,21 +206,21 @@ if($::opt_on) {
|
||||||
|
|
||||||
sub on {
|
sub on {
|
||||||
my $locate = shift;
|
my $locate = shift;
|
||||||
print("parallel -j1 echo 1 \\> ::: $locate\n");
|
print(q{bash -c 'parallel -j1 echo 1 \\> {} ::: }. $locate."'\n");
|
||||||
system("parallel -j1 echo 1 \\> ::: $locate\n");
|
system(q{bash -c 'parallel -j1 echo 1 \\> {} ::: }. $locate."'\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sub off {
|
sub off {
|
||||||
my $locate = shift;
|
my $locate = shift;
|
||||||
print("parallel -j1 echo 0 \\> ::: $locate\n");
|
print(q{bash -c 'parallel -j1 echo 0 \\> {} ::: }. $locate."'\n");
|
||||||
system("parallel -j1 echo 0 \\> ::: $locate\n");
|
system(q{bash -c 'parallel -j1 echo 0 \\> {} ::: }. $locate."'\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sub toggle {
|
sub toggle {
|
||||||
my $locate = shift;
|
my $locate = shift;
|
||||||
# If the file 'locate' contains 1 it should be put to 0.
|
# If the file 'locate' contains 1 it should be put to 0.
|
||||||
print('parallel -j1 grep -q 1 {} \; echo \$? \\> {} :::'." $locate\n");
|
print(q{bash -c 'parallel -j1 grep -q 1 {} \; echo \$? \\> {} ::: }. $locate."'\n");
|
||||||
system('parallel -j1 grep -q 1 {} \; echo \$? \\> {} :::'." $locate\n");
|
system(q{bash -c 'parallel -j1 grep -q 1 {} \; echo \$? \\> {} ::: }. $locate."'\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue