gnss-config: added return code if gpsd restart fails
Script returns 7 if gpsd restart failed. Used for lava testing. BugzID: 62045 Signed-off-by: Tobias Jäggi <tobias.jaeggi@netmodule.com>
This commit is contained in:
parent
fa5d8c2231
commit
90c8eef146
|
|
@ -13,6 +13,7 @@
|
||||||
# 4 saving to flash failed
|
# 4 saving to flash failed
|
||||||
# 5 baud rate specified in $CONFIG_FILE not supported by $DEVICE_NAME
|
# 5 baud rate specified in $CONFIG_FILE not supported by $DEVICE_NAME
|
||||||
# 6 set tty baud rate was not successful
|
# 6 set tty baud rate was not successful
|
||||||
|
# 7 failed to restart gpsd
|
||||||
|
|
||||||
# static variables
|
# static variables
|
||||||
DEVICE_NAME="NEO-M8L"
|
DEVICE_NAME="NEO-M8L"
|
||||||
|
|
@ -164,6 +165,15 @@ write_config_out(){
|
||||||
echo "Supported Augmentation Services: $augment_service" >> $CONFIG_OUT_FILE
|
echo "Supported Augmentation Services: $augment_service" >> $CONFIG_OUT_FILE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
restart_gpsd(){
|
||||||
|
if [ "$RESTART_GPSD" -eq "1" ]; then
|
||||||
|
systemctl start gpsd
|
||||||
|
if [ "$?" -ne "0" ]; then
|
||||||
|
exit 7 # failed to restart gpsd
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# start of main
|
# start of main
|
||||||
|
|
||||||
# check if script was launched by systemd
|
# check if script was launched by systemd
|
||||||
|
|
@ -239,9 +249,7 @@ if br_receiver="$(poll_baud_rate_receiver "$DESIRED_BAUD_RATE")";then
|
||||||
exit 6
|
exit 6
|
||||||
fi
|
fi
|
||||||
write_config_out
|
write_config_out
|
||||||
if [ "$RESTART_GPSD" -eq "1" ]; then
|
restart_gpsd
|
||||||
systemctl start gpsd
|
|
||||||
fi
|
|
||||||
# script can exit
|
# script can exit
|
||||||
exit 0 # baud rate of receiver is already matching $DESIRED_BAUD_RATE
|
exit 0 # baud rate of receiver is already matching $DESIRED_BAUD_RATE
|
||||||
else
|
else
|
||||||
|
|
@ -330,10 +338,6 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
write_config_out
|
write_config_out
|
||||||
|
restart_gpsd
|
||||||
# TODO: verify or error handling
|
|
||||||
if [ "$RESTART_GPSD" -eq "1" ]; then
|
|
||||||
systemctl start gpsd
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 0 # successfully changed baud rate to $DESIRED_BAUD_RATE specified in $CONFIG_FILE
|
exit 0 # successfully changed baud rate to $DESIRED_BAUD_RATE specified in $CONFIG_FILE
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue