Tools: add run-shellcheck.sh to statically analyze startup scripts

Use './Tools/run-shellcheck.sh ROMFS/px4fmu_common' to run it.
This commit is contained in:
Beat Küng
2018-08-13 07:49:22 +02:00
committed by Daniel Agar
parent 9712f6b02a
commit 4e860e357c
4 changed files with 55 additions and 5 deletions
@@ -1,4 +1,5 @@
# shellcheck disable=SC2154
mavlink stream -r 10 -s DISTANCE_SENSOR -u $udp_gcs_port_local
mavlink stream -r 10 -s VISION_POSITION_ESTIMATE -u $udp_gcs_port_local
@@ -3,6 +3,8 @@ mixer append /dev/pwm_output0 etc/mixers/mount_legs.aux.mix
mavlink start -x -u 14558 -r 4000 -f -m onboard -o 14530
# shellcheck disable=SC2154
mavlink stream -r 10 -s MOUNT_ORIENTATION -u $udp_gcs_port_local
# shellcheck disable=SC2154
mavlink stream -r 50 -s ATTITUDE_QUATERNION -u $udp_offboard_port_local
mavlink stream -r 10 -s MOUNT_ORIENTATION -u $udp_offboard_port_local
+11 -5
View File
@@ -2,13 +2,17 @@
# PX4 commands need the 'px4-' prefix in bash.
# (px4-alias.sh is expected to be in the PATH)
# shellcheck disable=SC1091
source px4-alias.sh
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#
# Main SITL startup script
#
# check for ekf2 replay
# shellcheck disable=SC2154
if [ "$replay_mode" == "ekf2" ]
then
sh etc/init.d-posix/rc.replay
@@ -96,11 +100,12 @@ else
fi
# multi-instance setup
param set MAV_SYS_ID $((1+$px4_instance))
simulator_udp_port=$((14560+$px4_instance))
udp_offboard_port_local=$((14557+$px4_instance))
udp_offboard_port_remote=$((14540+$px4_instance))
udp_gcs_port_local=$((14556+$px4_instance))
# shellcheck disable=SC2154
param set MAV_SYS_ID $((1+px4_instance))
simulator_udp_port=$((14560+px4_instance))
udp_offboard_port_local=$((14557+px4_instance))
udp_offboard_port_remote=$((14540+px4_instance))
udp_gcs_port_local=$((14556+px4_instance))
if [ $AUTOCNF == yes ]
then
@@ -163,6 +168,7 @@ fi
# Autostart ID
autostart_file_match="etc/init.d-posix/$(param show -q SYS_AUTOSTART)_*"
# shellcheck disable=SC2206
autostart_files=( $autostart_file_match )
autostart_file="${autostart_files[0]}" # use first match, but there should really only be one
if [ ! -e "$autostart_file" ]; then