73Linux/app/stable/x86_64/GPS.bapp
2022-11-15 11:18:45 -06:00

66 lines
1.7 KiB
Text
Executable file

BAPP=4.0
ID=GPS
Name=gps
Comment="GPS Base Software"
Ver=REPO
localVer=REPO
W3=
MENU(){
#add xgps to menu
cat >xgps.desktop <<EOF
[Desktop Entry]
Name=XGPS
GenericName=XGPS
Comment=GPS Data Viewer
Exec=/usr/bin/xgps
Icon=/usr/share/icons/Adwaita/scalable/devices/thunderbolt-symbolic.svg
Terminal=false
Type=Application
Categories=Utility
EOF
sudo -A mv xgps.desktop /usr/share/applications/
}
INSTALL(){
CUR_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
mkdir -p ${BAPSRC}
cd ${BAPSRC}
sudo -A apt install -y python3-gps gpsd-clients gpsd chrony python3-gi-cairo libgps-dev
sudo -A mv /etc/default/gpsd /etc/default/gpsd.org
sudo -A wget https://raw.githubusercontent.com/km4ack/pi-scripts/master/gpsd -P /etc/default/
CHRONYCHK=$(grep "refclock SHM 0 offset 0.5 delay 0.2 refid NMEA" /etc/chrony/chrony.conf)
if [ -z "$CHRONYCHK" ]; then
echo "refclock SHM 0 offset 0.5 delay 0.2 refid NMEA" | sudo -A tee -a /etc/chrony/chrony.conf
fi
#line below added per this issue - https://github.com/km4ack/pi-build/issues/146 24SEPT2020
sudo -A ln -s /lib/systemd/system/gpsd.service /etc/systemd/system/multi-user.target.wants/
#Set GPS by serial ID
#GPS Variable set by main script or update script and placed in config file
if [ "$GPS" != 'NONE' ]; then
sudo -A sed -i "s|DEVICES.*$|DEVICES=\"$GPS\"|g" /etc/default/gpsd
else
sudo -A sed -i "s|DEVICE.*|DEVICE=$GPS|" /etc/default/gpsd
fi
}
VERSION(){
if ! hash gpsd 2>/dev/null; then
CURRENT=0
NEWVER=REPO
else
CURRENT=REPO
NEWVER=REPO
fi
}
REMOVE(){
sudo -A apt purge -y python3-gps gpsd-clients gpsd chrony python3-gi-cairo libgps-dev
}