forked from km4ack/pi-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgpsinstall
More file actions
48 lines (38 loc) · 1.27 KB
/
gpsinstall
File metadata and controls
48 lines (38 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
#script to install GPS Dongle for Raspberry Pi
#km4ack 20190911
#Last Edit km4ack 20191014
#check if running as root
IAM=$(whoami)
if [ $IAM = "root" ]
then
echo
else
echo "Please run this script as root"
exit 0
fi
#install needed packages
echo "installing a few needed packages"
apt-get install -y gpsd gpsd-clients python-gps chrony python-gi-cairo
#backup gpsd file
mv /etc/default/gpsd /etc/default/gpsd.org
#download gpsd file
wget https://raw.githubusercontent.com/km4ack/pi-scripts/master/gpsd -P /etc/default/
echo "refclock SHM 0 offset 0.5 delay 0.2 refid NMEA" >> /etc/chrony/chrony.conf
#line below added per this issue - https://github.com/km4ack/pi-build/issues/146
#24SEPT2020
ln -s /lib/systemd/system/gpsd.service /etc/systemd/system/multi-user.target.wants/
echo "";echo "";echo ""
echo "#############################################################################################"
echo "#instructions at https://raw.githubusercontent.com/km4ack/pi-scripts/master/gps-instruction #"
echo "#############################################################################################"
echo "Reboot is needed to complete"
#echo "Would you like to reboot now? y/n"
#read ANSW
#if [ $ANSW = "y" ]
#then
#reboot
#else
#echo "GPS won't work until reboot"
#exit 0
#fi