diff --git a/ROMFS/px4fmu_common/init.d-posix/rcS b/ROMFS/px4fmu_common/init.d-posix/rcS index e7569139c7f4..fe0af0de50dc 100644 --- a/ROMFS/px4fmu_common/init.d-posix/rcS +++ b/ROMFS/px4fmu_common/init.d-posix/rcS @@ -108,11 +108,8 @@ fi param set MAV_SYS_ID $((px4_instance+1)) simulator_tcp_port=$((4560+px4_instance)) udp_offboard_port_local=$((14580+px4_instance)) -if [ $px4_instance > 9] - udp_offboard_port_remote=14549 -then - udp_offboard_port_remote=$((14540+px4_instance)) -fi +udp_offboard_port_remote=$((14540+px4_instance)) +[ $px4_instance > 9] && udp_offboard_port_remote=14549 # use the same ports for more than 10 instances to avoid port overlaps udp_gcs_port_local=$((18570+px4_instance))