diff --git a/ROMFS/px4fmu_common/init.d-posix/rcS b/ROMFS/px4fmu_common/init.d-posix/rcS index 31d5179c00..8cb15f8e5a 100644 --- a/ROMFS/px4fmu_common/init.d-posix/rcS +++ b/ROMFS/px4fmu_common/init.d-posix/rcS @@ -149,9 +149,21 @@ then fi # Autostart ID -autostart_file=$( ls -- etc/init.d-posix/"$(param show -q SYS_AUTOSTART)"_* ) +autostart_file='' +for f in etc/init.d-posix/"$(param show -q SYS_AUTOSTART)"_* +do + filename=$(basename "$f") + case "$filename" in + *\.*) + # ignore files that contain a dot (e.g. .post) + ;; + *) + autostart_file="$f" + ;; + esac +done if [ ! -e "$autostart_file" ]; then - echo "Error: no autostart file found" + echo "Error: no autostart file found ($autostart_file)" exit -1 fi