hydrophonitor/scripts/setup-gps.sh

20 lines
512 B
Bash
Raw Normal View History

#!/bin/sh
2022-10-11 06:17:13 +00:00
echo "Setting up GPS recording"
sudo apt-get update && sudo apt-get install -y \
gpsd gpsd-clients
sudo pip install -r /home/pi/hydrophonitor/gps-logger/requirements.txt
sudo systemctl stop gpsd.socket
sudo systemctl disable gpsd.socket
device="/dev/ttyUSB0"
sudo gpsd ${device} -F /var/run/gpsd.sock
sudo sed -i "s|DEVICES=\"\"|DEVICES=\"${device}\"|g" /etc/default/gpsd
2022-10-11 06:17:13 +00:00
sudo grep -qxF "START_DAEMON=\"true\"" /etc/default/gpsd || echo "START_DAEMON=\"true\"" | sudo tee -a /etc/default/gpsd