嘿,我为我的 pi 编写了这个小 shell 脚本来上传图片,但是每次我运行脚本时,我都会得到“文件意外结束”,我什至没有向我显示第一个回声。
谢谢你的帮助 :)
raspistill -o snapshot2.jpg
HOST=XXXXX #This is the FTP servers host or IP address.
USER= XXXX #This is the FTP user that has access to the server.
PASS=XXXXX #This is the password for the FTP user.
NOW=$(date +"%c")
echo test
if [ -f work ];
then
echo >> ftp.log "$NOW Script failure"
echo ein prozess arbeitet noch
else
echo beginne upload
touch work
ftp -inv $HOST << EOF
user $USER $PASS
cd /bilder2/
put snapshot2.jpg
bye
echo >> ftp.log "$NOW Upload Success"
rm work
echo erfolgreicher upload
fi
EOF