diff --git a/Tools/px4airframes/rcout.py b/Tools/px4airframes/rcout.py index 4142c44f46..080eb403b2 100644 --- a/Tools/px4airframes/rcout.py +++ b/Tools/px4airframes/rcout.py @@ -28,10 +28,10 @@ class RCOutput(): "# 12000 .. 12999 Octo Cox\n" "# 13000 .. 13999 VTOL\n" "# 14000 .. 14999 Tri Y\n" - "" - "" - "cd /etc/init.d/airframes\n" "\n") + result += "\n" + result += "set AIRFRAME none\n" + result += "\n" for group in groups: result += "# GROUP: %s\n\n" % group.GetName() for param in group.GetParams(): @@ -62,7 +62,7 @@ class RCOutput(): result += "# %s\n" % param.GetName() result += "if param compare SYS_AUTOSTART %s\n" % id_val result += "then\n" - result += "\tsh %s\n" % path + result += "\tset AIRFRAME %s\n" % path result += "fi\n" #if long_desc is not None: @@ -70,6 +70,17 @@ class RCOutput(): result += "\n" result += "\n" + result += "\n" + result += "if [ ${AIRFRAME} != none ]\n" + result += "then\n" + result += "\tsh /etc/init.d/airframes/${AIRFRAME}\n" + if not post_start: + result += "else\n" + result += "\techo \"ERROR [init] No file matches SYS_AUTOSTART value found in : /etc/init.d/airframes\"\n" + result += "\techo \"ERROR [init] No file matches SYS_AUTOSTART value found in : /etc/init.d/airframes\" >> $LOG_FILE\n" + result += "\ttone_alarm ${TUNE_ERR}\n" + result += "fi\n" + result += "unset AIRFRAME" self.output = result def Save(self, filename):