diff --git a/download_and_execute.sh b/download_and_execute.sh index f0d5733..7285dd5 100644 --- a/download_and_execute.sh +++ b/download_and_execute.sh @@ -39,6 +39,14 @@ check_software "git" # 检查某个Python库 #check_python_library "numpy" +# 检查 libcamera-still 命令是否存在 +if command -v libcamera-still >/dev/null 2>&1; then + echo "libcamera-still 命令存在" +else + echo "libcamera-still 命令不存在" + exit 1 +fi + # 设置仓库URL和本地目录 repo_url="https://bdgit.educoder.net/pv2ajsu8k/smp_pc_20240625.git" @@ -89,7 +97,7 @@ if [ -f "smp_init.sh" ]; then fi # 执行smp_init.sh - ./smp_init.sh +# ./smp_init.sh echo "smp_init.sh 执行完成" else echo "smp_init.sh 不存在" diff --git a/smp_init.sh b/smp_init.sh index 9f642a9..662eef2 100644 --- a/smp_init.sh +++ b/smp_init.sh @@ -43,5 +43,21 @@ echo "要退出虚拟环境,请运行 'deactivate'" # 运行第一关的mqtt_client.py -nohup sudo $env_dir/bin/python3 smp_coder/mqtt_client.py > log.txt 2>&1 & +# 运行第一关的mqtt_client.py +nohup sudo $env_dir/bin/python3 smp_coder/mqtt_smp.py > log.txt 2>&1 & +if [ $? -eq 0 ]; then + echo "mqtt_smp.py 启动成功" +else + echo "mqtt_smp.py 启动失败" +fi + +# 运行第二关的extur_smp.py +nohup sudo $env_dir/bin/python3 smp_coder/extur_smp.py > logex.txt 2>&1 & +if [ $? -eq 0 ]; then + echo "extur_smp.py 启动成功" +else + echo "extur_smp.py 启动失败" +fi + +