2021-05-02 11:17:22 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if [ $# -ge 1 ]; then
|
|
|
|
cmd="$@"
|
|
|
|
else
|
2021-05-31 20:39:02 +00:00
|
|
|
cmd="~/bin/sync-all-repos staticonly"
|
2021-05-02 11:17:22 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
for notebook in nb1 nb2 nb3 bridge line hike freiheit; do
|
|
|
|
found=""
|
|
|
|
|
2021-05-02 11:20:10 +00:00
|
|
|
printf "Looking for ${notebook} ... "
|
2021-05-02 11:17:22 +00:00
|
|
|
for place in place7 place10; do
|
|
|
|
if [ -z "$found" ]; then
|
|
|
|
fqdn=${notebook}.${place}.ungleich.ch
|
2021-05-05 08:54:52 +00:00
|
|
|
ping -c2 ${fqdn} >/dev/null 2>&1 && found=$place
|
2021-05-02 11:17:22 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ "$found" ]; then
|
2021-05-02 11:20:10 +00:00
|
|
|
echo found ${notebook} in ${found}: ${fqdn}
|
2021-05-02 11:17:22 +00:00
|
|
|
ssh nico@${fqdn} ${cmd}
|
|
|
|
else
|
2021-05-02 11:20:10 +00:00
|
|
|
echo "did not reach ${notebook}."
|
2021-05-02 11:17:22 +00:00
|
|
|
fi
|
|
|
|
done
|