2019-11-23 21:14:03 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-12-26 22:29:28 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021-2022 Ole Tange, http://ole.tange.dk and Free Software and Foundation, Inc.
|
2021-03-22 20:16:35 +00:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2019-11-23 21:14:03 +00:00
|
|
|
unset TIMEOUT
|
2021-06-22 17:40:07 +00:00
|
|
|
torsocks bash <<'EOF'
|
2019-11-23 21:14:03 +00:00
|
|
|
. `which env_parallel.bash`
|
|
|
|
env_parallel --session
|
|
|
|
|
2022-02-17 12:19:55 +00:00
|
|
|
host=$(parallel -j0 --halt now,success=1 ssh {} echo {} ::: kodi koditor huator fairtor 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() {
|
2021-06-22 17:40:07 +00:00
|
|
|
export PARALLEL_SSH='ssh -p2222 -o "StrictHostKeyChecking no"'
|
2020-04-22 18:15:59 +00:00
|
|
|
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
|
2021-06-22 17:40:07 +00:00
|
|
|
EOF
|