summaryrefslogtreecommitdiffabout
authorMichael Krelin <hacker@klever.net>2012-01-21 10:22:45 (UTC)
committer Michael Krelin <hacker@klever.net>2012-01-21 10:22:45 (UTC)
commitf1b7212e0220054bcdd4053d808939dfe3a1f52e (patch) (unidiff)
tree5fe77081af899697b641f929fb33d6c0a17c5ab2
parent16ae25ecd207b01b79cb7ccb72e81d2a9e84f59b (diff)
downloadiii-f1b7212e0220054bcdd4053d808939dfe3a1f52e.zip
iii-f1b7212e0220054bcdd4053d808939dfe3a1f52e.tar.gz
iii-f1b7212e0220054bcdd4053d808939dfe3a1f52e.tar.bz2
make tag-photo.bash script exit nicer
meaning, "return" if sourced in Signed-off-by: Michael Krelin <hacker@klever.net>
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--doc/tag-photo.bash6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/tag-photo.bash b/doc/tag-photo.bash
index 83f10fd..5917f12 100644
--- a/doc/tag-photo.bash
+++ b/doc/tag-photo.bash
@@ -39,15 +39,15 @@ END {
39 if((pdt-ap_dt[i])>1800) continue; 39 if((pdt-ap_dt[i])>1800) continue;
40 printf("<access-point><mac>%s</mac><signal-strength>-%d</signal-strength></access-point>\n",ap_ap[i],ap_rssi[i]); 40 printf("<access-point><mac>%s</mac><signal-strength>-%d</signal-strength></access-point>\n",ap_ap[i],ap_rssi[i]);
41 } 41 }
42} 42}
43')" 43')"
44 44
45[[ -z "$APS" ]] && { echo "no access points" ; exit ; } 45[[ -z "$APS" ]] && { echo "no access points" ; return 2>/dev/null || exit ; }
46WL="$(wps_locate "$APS")" 46WL="$(wps_locate "$APS")"
47[[ -z "$WL" ]] && { echo "couldn't find location" ; exit ; } 47[[ -z "$WL" ]] && { echo "couldn't find location" ; return 2>/dev/null || exit ; }
48eval "$WL" 48eval "$WL"
49[[ -z "$wl_latitude" || -z "$wl_longitude" || -z "$wl_hpe" ]] && { echo "invalid location ($WL)"; exit; } 49[[ -z "$wl_latitude" || -z "$wl_longitude" || -z "$wl_hpe" ]] && { echo "invalid location ($WL)"; return 2>/dev/null || exit; }
50[[ "${wl_latitude:0:1}" = '-' ]] && wl_latitude="${wl_latitude:1}" wl_latitude_ref=S || wl_latitude_ref=N 50[[ "${wl_latitude:0:1}" = '-' ]] && wl_latitude="${wl_latitude:1}" wl_latitude_ref=S || wl_latitude_ref=N
51[[ "${wl_longitude:0:1}" = '-' ]] && wl_longitude="${wl_longitude:1}" wl_longitude_ref=W || wl_longitude_ref=E 51[[ "${wl_longitude:0:1}" = '-' ]] && wl_longitude="${wl_longitude:1}" wl_longitude_ref=W || wl_longitude_ref=E
52exiftool -GPSLatitude="$wl_latitude" -GPSLongitude="$wl_longitude" -GPSLatitudeRef=$wl_latitude_ref -GPSLongitudeRef=$wl_longitude_ref -GPSVersionID=0.0.2.2 -GPSProcessingMethod=WLAN "$JPG" 52exiftool -GPSLatitude="$wl_latitude" -GPSLongitude="$wl_longitude" -GPSLatitudeRef=$wl_latitude_ref -GPSLongitudeRef=$wl_longitude_ref -GPSVersionID=0.0.2.2 -GPSProcessingMethod=WLAN "$JPG"
53# XXX: exiftool doesn't like it -GPSHPositioningError="$wl_hpe" 53# XXX: exiftool doesn't like it -GPSHPositioningError="$wl_hpe"