mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-03-25 03:04:12 +08:00
Replace the two separate echo lines ("Starting" and "(arch)") with a
single line showing architecture and UTC timestamp:
[docker-entrypoint.sh] aarch64 | 2026-02-09T15:23:45Z
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
26 lines
723 B
Bash
Executable File
26 lines
723 B
Bash
Executable File
#!/bin/bash
|
|
|
|
GREEN='\033[0;32m'
|
|
NO_COLOR='\033[0m' # No Color
|
|
SCRIPTID="${GREEN}[docker-entrypoint.sh]${NO_COLOR}"
|
|
|
|
echo -e "$SCRIPTID $( uname -m ) | $(date -u +%FT%TZ)"
|
|
|
|
# Start virtual X server in the background
|
|
# - DISPLAY default is :99, set in dockerfile
|
|
# - Users can override with `-e DISPLAY=` in `docker run` command to avoid
|
|
# running Xvfb and attach their screen
|
|
if [[ -x "$(command -v Xvfb)" && "$DISPLAY" == ":99" ]]; then
|
|
echo -e "$SCRIPTID Starting Xvfb"
|
|
Xvfb :99 -screen 0 1600x1200x24+32 &
|
|
fi
|
|
|
|
# Check if the ROS_DISTRO is passed and use it
|
|
# to source the ROS environment
|
|
if [ -n "${ROS_DISTRO}" ]; then
|
|
echo -e "$SCRIPTID ROS: ${ROS_DISTRO}"
|
|
source "/opt/ros/$ROS_DISTRO/setup.bash"
|
|
fi
|
|
|
|
exec "$@"
|