1.led_startup.sh
#!/bin/sh
### BEGIN INIT INFO
# Provides: led_startup
# Required: no
# Default: no
# Description: Starts the LED program at boot
### END INIT INFO
# 定义LED程序的路径
LED_PROGRAM_PATH=/root/LED_and_TempHumi
# 检查程序是否存在
if [! -f $LED_PROGRAM_PATH ]; then
echo "LED program not found at $LED_PROGRAM_PATH"
exit 1
fi
export QT_QPA_PLATFORM=linuxfb
# 启动LED程序
$LED_PROGRAM_PATH &
exit 0
加一个运行权限
chmod +x led_startup.sh