Upload to dropBox [Resolved]
-
Hi
I have with (great) success used the following script:
dropbox_uploader.sh (from https://github.com/andreafabrizi/Dropbox-Uploader)on my RasPi-0.
I know it's a bash script, but because Omega2's shell (ash) is fairly compatible, I had hoped it could run here too:
But no!
I get the following error:
grep: /tmp/du_resp_7079: No such file or directoryI see 3 possible solutions:
- Correct the script.
- Switch from ash to bash on the Omega2.
- Find another solution.
Unfortunately, I have no solution to any of these three.
Can anyone help?
-
@Poul-Christoffersen
The leastpainlesspainful might be to try installing bash. I see a version in the Omega2 packages repo (bash_4.3.42-1_mipsel_24kc.ipk).Have you tried installing it with:
opkg install bash
I'd try myself, but am not close to an O2 atm.
From the error posted, the script is unable to locate the response file, which would indicate that it's not being created, however the reason for that is not so clear.
If installing bash fails to solve the problem, I see there is a '-d' parameter that you can pass to dropbox_uploader.sh which enables debug mode and could assist further in isolating what is going awry. But before posting any debug output, check it and redact any details you are not comfortable sharing with the world.
-
@cas said in Upload to dropBox:
opkg install bash
bash seems to be pre-installed on the Omega2
I started bash but still get the error:grep: /tmp/du_resp_6939: No such file or directory
-
@Poul-Christoffersen
Ok, the script is using curl to an https site and iirc, on my O2's I had a ca-certificate related problem last time I tried that. Let's check that your curl is not throwing an error on https connection.
What is the output of:curl https://www.google.com
-
Output is:
curl: (77) Error reading ca cert file /etc/ssl/certs/ca-certificates.crt - mbedTLS: (-0x3E00) PK - Read/write of file failed
-
@Poul-Christoffersen
Yes, that sounds familiar.
Try installing the ca-certificates package and re-running the curl command and see if the output changes.opkg install ca-certificates
-
After
opkg install ca-certificates=>Same error:
curl: (77) Error reading ca cert file /etc/ssl/certs/ca-certificates.crt - mbedTLS: (-0x3E00) PK - Read/write of file failed
-
@Poul-Christoffersen
Ok, let's try the other one, ca-bundle.opkg install ca-bundle
Then try the curl command again and see if the output has changed.
-
New output
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="https://www.google.dk/?gws_rd=cr&dcr=0&ei=CRJWWonhCsOE6ASVgKboDQ">here</A>.
</BODY></HTML>
-
.... and the upload to dropbox:
This also seems to work!!!
You saved my day. Thanks.
-
@Poul-Christoffersen
Cool, that means curl is working with https and should hopefully now create the response file that grep is looking for.Try your dropbox_downloader.sh script again.That's good news, if you don't mind, please edit the topic title and insert [Resolved] so that if anyone else searches for dropbox_uploader they'll hopefully get it working the easy way.
-
Sorry...?
(How to to that?)
-
@Poul-Christoffersen
Click on the three vertical dots to the right of 'reply quote' of your first post, select 'Edit' and then just edit the topic title. (I hope)
-
in reading the script it seems to indicate that the response file directory has to be one that is set by user and default is /tmp . if that does not exist then set to one that does exist.
-
Update:
Using the mentioned script is possible without switching to bash!
Just follow the instructions that "cat" gave.
And many thanks to "cat" for the great and competent effort!
-
Sorry his name is "cas"
-
Perhaps this may help...
install_bash () { PASSWD=/etc/passwd TMP=$PASSWD.tmp opkg list_installed | grep bash > /dev/null if [ $? -eq 0 ] ; then grep /bin/bash $PASSWD if [ $? -eq 0 ]; then return 0 fi fi opkg update opkg install bash cp $PASSWD $TMP cat $TMP | sed 's|/bin/ash|/bin/bash|' > $PASSWD rm $TMP }
--Bill