Skip to content

Commit

Permalink
ffda-geolocate: add script
Browse files Browse the repository at this point in the history
  • Loading branch information
blocktrron committed Jul 27, 2024
1 parent 8cd718f commit b564875
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions openwrt/oob-packages/ffda-oob-firmware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ define Package/ffda-oob-firmware/install
$(INSTALL_BIN) ./files/uci-defaults.sh $(1)/etc/uci-defaults/99_ffda-oob-firmware
$(INSTALL_BIN) ./files/label-mac.sh $(1)/lib/ffda-oob-firmware/
$(INSTALL_BIN) ./files/ffda-notes.sh $(1)/usr/bin/ffda-notes
$(INSTALL_BIN) ./files/ffda-geolocate.sh $(1)/usr/bin/ffda-geolocate

$(CP) ./files/authorized_keys $(1)/lib/ffda-oob-firmware/conffiles/authorized_keys
$(CP) ./files/config/* $(1)/lib/ffda-oob-firmware/conffiles/config/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

config geolocator 'geolocator'
option api_key 'GEOLOCATOR_API_KEY'
13 changes: 13 additions & 0 deletions openwrt/oob-packages/ffda-oob-firmware/files/ffda-geolocate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

API_KEY="$(uci get ffda-oob-firmware.geolocator.api_key)"

if [ -z "$API_KEY" ]; then
echo "No API key found. Please set one in the configuration."
exit 1
fi

# Get the current location
ip link set dev wlan0 up
clocate -p google -k AIzaSyA6ox6kpT0PXoxepY77xudrhJ9Y9W5Birc
ip link set dev wlan0 down

0 comments on commit b564875

Please sign in to comment.