Hmmm. So, when you start the script manually; i.e.
./S50wireguard start
, your client starts and you can use it. But it is not starting when entware starts it on a bootup (as you don't see the dbug file created). That is weird.
There is a logger statement in the script. Do you see the script trying to start in the syslog?
The only thing I can suggest, as I stated above, the WAN has to be up before the client will start. I suggest you create a
/jffs/scripts/wan-event
script and add the following;
Code:
#!/bin/sh
# variables passed to wan-event
# $1 > Wan Adaptor Number
# $2 > Wan state
# init
# connecting
# connected
# disconnected
# stopped
# disabled
# stopping
case $2 in
"connected")
sleep 5
C1="True"
C2=0
while [ "$C1" = "True" ]
do
if [ "$(nvram get ntp_ready)" -eq 0 ]; then
sleep 10
let "C2=C2+1"
if [ "$C2" -gt 10 ]; then
logger "wan-event - wan event script did not start - ntp server failed to respond"
exit
fi
else
C1="False"
sleep 10
/path/to/wireguard_client_script
fi
done
;;
esac
replacing
/path/to/wireguard_client_script
with the path to the script that starts your client (S50wireguard). I would move it out of the init.d directory as it is clearly not doing anything there.
Unless I am missing something, that is about all I can help you with. I still think you may be better off installing
wireguard_manager
from amtm and setup your client that way.