1
嘿,我寫了這個小的shell腳本爲我的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