ModalAI Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    voxl-send-command exit status implementation request

    Feature Requests
    2
    4
    16
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jameskuesel
      last edited by jameskuesel

      Super super low priority but I noticed that voxl-send-command doesn't output a return code. Even on an error can look like a success since echo will return exit status 0. This is particularly frustrating when an error does actually occur.

      https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-mpa-tools/-/blob/master/scripts/voxl-send-command?ref_type=heads

      Here is a fix below:

      if [ -p "/run/mpa/${1}/control" ]; then
          _CONTROL_FILE="/run/mpa/${1}/control"
          shift
          echo "$@" >> "$_CONTROL_FILE"
          echo "Successfully sent command to ${_CONTROL_FILE}"
          exit 0
      
      elif [ -p "${1}/control" ]; then
          _CONTROL_FILE="${1}/control"
          shift
          echo "$@" >> "$_CONTROL_FILE"
          echo "Successfully sent command to ${_CONTROL_FILE}"
          exit 0
      else
          echo "Unable to find valid pipe that accepts control commands at: ${1}"
          exit 1
      fi
      
      
      

      Would love to see an update here!

      Also side note: Let me know if this is the proper channel so submit code issues like these.

      Eric KatzfeyE 1 Reply Last reply Reply Quote 0
      • Eric KatzfeyE
        Eric Katzfey ModalAI Team @jameskuesel
        last edited by

        @jameskuesel Feel free to make the change and submit a PR

        J 1 Reply Last reply Reply Quote 0
        • J
          jameskuesel @Eric Katzfey
          last edited by

          @Eric-Katzfey

          Sorry my bad! Done!

          Eric KatzfeyE 1 Reply Last reply Reply Quote 0
          • Eric KatzfeyE
            Eric Katzfey ModalAI Team @jameskuesel
            last edited by

            @jameskuesel Thanks! Merged

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Powered by NodeBB | Contributors