Files
emcomm-tools-os-community/overlay/opt/emcomm-tools/sbin/wrapper-gpsd.sh
T
2024-10-06 06:52:57 -07:00

42 lines
586 B
Bash
Executable File

#!/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