GPS - Adjusted approach for managing GPS

This commit is contained in:
Gaston Gonzalez
2024-10-06 06:52:57 -07:00
parent 8a2ec1aa3d
commit 8a8f07a22d
7 changed files with 83 additions and 14 deletions
+41
View File
@@ -0,0 +1,41 @@
#!/bin/bash
#
# Author : Gaston Gonzalez
# Date : 4 October 2024
# Purpose : Wrapper startup/shutdown script around systemd/gpsd
WAIT=5
start() {
et-log "Waiting to start gpsd for ${WAIT} seconds..."
sleep ${WAIT}
/usr/bin/systemctl restart gpsd
}
stop() {
et-log "Waiting to stop gpsd for ${WAIT} seconds..."
sleep ${WAIT}
/usr/bin/systemctl stop gpsd
}
usage() {
echo "usage: $(basename $0) <cmd>"
echo " <cmd> [start|stop]"
}
if [ $# -ne 1 ]; then
usage
exit 1
fi
case $1 in
start)
start
;;
stop)
stop
;;
*)
usage
;;
esac