2019-11-23 21:14:03 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
unset TIMEOUT
|
|
|
|
. `which env_parallel.bash`
|
|
|
|
env_parallel --session
|
|
|
|
|
|
|
|
host=$(parallel -j0 --halt now,success=1 ssh {} echo {} ::: android1 android2 2>/dev/null)
|
2020-04-22 18:15:59 +00:00
|
|
|
if [ -z "$host" ] ; then
|
|
|
|
echo Error: no android host working
|
|
|
|
else
|
|
|
|
echo $host >&2
|
2019-11-23 21:14:03 +00:00
|
|
|
|
2020-04-22 18:15:59 +00:00
|
|
|
doit() {
|
|
|
|
export PARALLEL_SSH='ssh -p2222'
|
|
|
|
parallel -k echo ::: Basic usage works
|
|
|
|
parallel -k -S localhost echo ::: Remote usage works
|
|
|
|
}
|
2019-11-23 21:14:03 +00:00
|
|
|
|
2020-04-22 18:15:59 +00:00
|
|
|
scp /usr/local/bin/parallel $host:/data/data/com.termux/files/usr/bin
|
|
|
|
env_parallel -S $host doit ::: a
|
|
|
|
fi
|