From 7ab2c4c343ebadd257a592d9c440c44a4a9e6c00 Mon Sep 17 00:00:00 2001 From: thetechprepper Date: Sun, 17 Aug 2025 03:32:06 -0700 Subject: [PATCH] voacap - Enabled maidenhead grid square service --- .../.local/share/emcomm-tools/voacap/et-voacap.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/overlay/etc/skel/.local/share/emcomm-tools/voacap/et-voacap.sh b/overlay/etc/skel/.local/share/emcomm-tools/voacap/et-voacap.sh index 17e5238..e3db281 100755 --- a/overlay/etc/skel/.local/share/emcomm-tools/voacap/et-voacap.sh +++ b/overlay/etc/skel/.local/share/emcomm-tools/voacap/et-voacap.sh @@ -20,14 +20,11 @@ lookup_station() { fi ;; grid) - echo "Grid not support not yet implemented" - exit 1 - - #curl -f -s "http://localhost:1981/api/geo/grid=${value}" > "$json_file" - #if [[ $? -ne 0 ]]; then - # echo "Location not found for grid: ${value}. Exiting." - # exit 1 - #fi + curl -f -s "http://localhost:1981/api/geo/grid?gridSquare=${value}" | jq '{lat: .position.lat, lon: .position.lon}' > "$json_file" + if [[ $? -ne 0 ]]; then + echo "Error converting grid to lat/lon: ${value}. Exiting." + exit 1 + fi ;; latlon) # Write directly to JSON for consistency @@ -59,6 +56,7 @@ if [[ ! -e ${ET_SSN} ]]; then echo -e "${YELLOW}Try running the following to fetch the sunspot numbers (requires Internet):${NC}" echo -e "${WHITE}cd ${HOME}/.local/share/emcomm-tools/voacap${NC}" echo -e "${WHITE}./fetch-ssn.sh${NC}" + exit 1 fi