我有一个经过修改的AWS basicPubSub函数,可以将数据传输到AWS IoT核心,我希望脚本在启动时运行。
我已将此脚本添加到其中,使其可执行并更新了init.d
/etc/init.d
chmod 755 LOMAWS.sh
sudo update-rc.d LOMAWS.sh defaults
但是脚本无法启动,如何使它从启动开始运行?
clear
echo "LOM AWS Script starting"
cd /home/pi/Documents/awsiot/aws-iot-device-sdk-python/samples/basicPubSub
sudo python basicPubSub.py -e "XXXXXXXX-ats.iot.us-east-2.amazonaws.com" -r root_CA.crt -c XXXXXXXX-certificate.pem.crt -k XXXXXXX-private.pem.key