M350b版本

This commit is contained in:
xin
2026-01-21 14:44:51 +08:00
parent a76d4b77e9
commit 742b0a1e5a
14 changed files with 92 additions and 45 deletions

24
choosescript.sh Normal file
View File

@ -0,0 +1,24 @@
#!/bin/bash
# 定义配置文件路径
CONFIG_FILE="/home/DJI/Settings/HardwareSettings.ini"
# 判断文件是否存在
if [ ! -f "$CONFIG_FILE" ]; then
echo "错误: 找不到配置文件 $CONFIG_FILE"
exit 1
fi
# 提取 AirplaneType 的值
# 1. grep 找到包含 AirplaneType 的行
# 2. cut 以 '=' 为分隔符取第二个字段
# 3. tr -d 去除回车符(\r)和空格,防止空字符导致判断失败
PLANE_TYPE=$(grep "AirplaneType" "$CONFIG_FILE" | cut -d'=' -f2 | tr -d '\r ')
echo "当前的机型是: [$PLANE_TYPE]"
# 进行判断
if [ "$PLANE_TYPE" = "M400" ]; then
echo "执行 bash a.sh"
chmod +x /root/raspusb.sh
bash /root/raspusb.sh
else
echo "机型不是 M400执行 sh b.sh"
chmod +x /root/mountdjirndis.sh
sh /root/mountdjirndis.sh
fi