From 09563c94ce05644b146a06bcd633f79514e0b0ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Wed, 3 Oct 2018 13:49:59 +0200 Subject: [PATCH] rcS: fix typhoon_h480 The typhoon has a 6011_typhoon_h480.post script that got matched as well. Now we exclude all files that contain a dot (apparently it's not so easy to do generic pattern matching in a portable way, but this works). --- ROMFS/px4fmu_common/init.d-posix/rcS | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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