fetch-current-data.sh 692 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. SERVICES_HOST="${1:-ffpb-services}"
  3. MYDIR="$(dirname $0)"
  4. MYDIR="$(readlink -f $MYDIR)"
  5. pushd $MYDIR >/dev/null
  6. echo -en "Fetching current BATCAVE data from $SERVICES_HOST ... 0/5"
  7. ssh $SERVICES_HOST alfred-json -z -r 158 > "${MYDIR}/alfred-158.json"
  8. echo -en "\x08\x08\x081/5"
  9. ssh $SERVICES_HOST alfred-json -z -r 159 > "${MYDIR}/alfred-159.json"
  10. echo -en "\x08\x08\x082/5"
  11. ssh $SERVICES_HOST batctl gwl > "${MYDIR}/batctl-gwl.txt"
  12. echo -en "\x08\x08\x083/5"
  13. ssh $SERVICES_HOST batctl vd json -n > "${MYDIR}/batctl-vd.json"
  14. echo -en "\x08\x08\x084/5"
  15. ssh $SERVICES_HOST batadv-vis -f jsondoc > "${MYDIR}/batadv-vis.json"
  16. echo -en "\x08\x08\x08done\n"
  17. popd > /dev/null