mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Several helper scripts assumes bash is available at /bin/bash. That breaks on systems such as NixOS, where bash is resolved from PATH instead of a fixed /bin location and causes failures like `bad interpreter` during `make format`, e.g., on my host machine: ```sh $ make format /PX4-Autopilot/Tools/astyle/check_code_style.sh: /PX4-Autopilot/Tools/astyle/fix_code_style.sh: /bin/bash: bad interpreter: No such file or directory ``` This change switches these entrypoints to `#!/usr/bin/env bash` so they locate bash properly. No functional changes intended. Signed-off-by: Onur Özkan <work@onurozkan.dev>
15 lines
304 B
Bash
Executable File
15 lines
304 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
# Stop voxl-px4 service if running
|
|
if command -v systemctl > /dev/null 2>&1; then
|
|
systemctl stop voxl-px4 2>/dev/null || true
|
|
fi
|
|
|
|
# Remove px4-* symlinks
|
|
for f in /usr/bin/px4-*; do
|
|
if [ -L "$f" ] && [ "$(readlink "$f")" = "px4" ]; then
|
|
rm -f "$f"
|
|
fi
|
|
done
|