When running the script from OpenWrt CLI everything works as expected. The file is copied without any further question. (keys are exchanged for user root)
But when started by the init.d script nothing happens.
When looking at process list I found this:
$ ps w
22988 root 1012 S scp /tmp/text.txt r2s.far.xa /tmp/rtext.txt
22989 root 1040 S /usr/bin/dbclient r2s.far.xa scp -t /tmp/rtext.txt
Tried /usr/bin/scp instead of scp. No difference.
My original script contains a endless loop. So I have to start it as daemon of course.
Finaly using procd is much easier. I.e. nothing to care about pid's and so on.
As I said I have stripped it down to only a few lines to reproduce the problem.
Invoke scp with -i fullpathtoprivatekeyfile rather than counting on it being found from the home directory. Also the dropbear client requires private key data in a different format than OpenSSH, the dropbearconvert utility must be run on them. I assume you've already tested the ability to scp from the command line.
This means your script will start first, the network will not be ready to use. Even 95 that the OP used is not necessarily late enough.