andreafabrizi / Dropbox-Uploader

Dropbox Uploader is a BASH script which can be used to upload, download, list or delete files from Dropbox, an online file sharing, synchronization and backup service.
https://www.andreafabrizi.it/2016/01/01/Dropbox-Uploader/
GNU General Public License v3.0
6.57k stars 1.08k forks source link

line 678: $OUT_FILE: ambiguous redirect #471

Closed turnbuj closed 5 years ago

turnbuj commented 5 years ago

I have four Raspberry Pi's running this simple display screen in different locations and using different dropbox accounts. Three of them are Pi Zero W's and one is an older RP1 with a wired network. The RP1 is still working fine but the other three have recently all stopped and producing the error: /home/pi/pishow/dropbox_uploader.sh: line 678: $OUT_FILE: ambiguous redirect

If I call the command directly, I get:

pi@raspberrypi:~ $ /home/pi/pishow/dropbox_uploader.sh -s download slideshow/. /home/pi/pishow/

Downloading folder "/slideshow" to "/home/pi/pishow/slideshow"... /home/pi/pishow/dropbox_uploader.sh: line 678: $OUT_FILE: ambiguous redirect

However, if I try to download one file by name, it works which I guess proves the token is correct and connection is possible.

bash /home/pi/pishow/dropbox_uploader.sh download /slideshow/IMG_7963.jpg /home/pi/pishow/

Downloading "/slideshow/IMG_7963.jpg" to "/home/pi/pishow/slideshow/IMG_7963.jpg"... DONE

When I try to list the distant dropbox, it fails: pi@raspberrypi:~ $ bash /home/pi/pishow/dropbox_uploader.sh list

Listing "/"... FAILED

Since all three have stopped at about the same time it looks like Dropbox have changed something but then, the older Pi is still ok. I can list on that one as well. Could there be a timing error where the older device copes better? I'm afraid my bash knowledge is very basic. Any advice much appreciated. The RP1 is running bash version 4.3.30(1) The others are all running 4.4.12(1)

Further, I just experimented with list and search. The following search produces a curious result in that it reports FAILED then goes on to display the two folders correctly... pi@raspberrypi:~ $ /home/pi/pishow/dropbox_uploader.sh search /john

Searching for "/john"... FAILED [D] /john [D] /john/john1

turnbuj commented 5 years ago

Solved! See code. latest version working. It appears that Dropbox servers are sending HTTP 2 status codes. Thanks to Jasonc i believe for the updates.