硬件: 树莓派 Raspberry 3B+
系统: Raspbian GNU/Linux 9 (stretch)
内核: Linux raspberrypi 4.14.93-v7+ #1189 SMP, armv7l GNU/Linux
开机启动脚本
#!/bin/sh
### BEGIN INIT INFO
# Provides: serial
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start or stop the serial communication of ttyACM0,1
### END INIT INFO
case $1 in
start)
echo -n "start serial communication of ttyACM0,1"
cd /var/www/usb-nrf52840/c-code/serial-sqlite3
sudo ./serial
;;
stop)
killall serial
;;
*)
echo "Usage: $0 (start|stop)"
;;
esac