When it runs from there it malfunctions but I can't see anything in the log. First how do I get it's errors visible in the log? and second any idea what could be wrong. I do know the script is running but the files it writes variables to are all blank. Here is the code https://pastebin.com/GJafHTY1
Code:
#!/bin/sh
#sets script dir as working dir
cd "$(dirname "$0")"
PIA_CERT="ca.rsa.4096.crt"
PIA_TOKEN=$(cat PIA_TOKEN)
PIA_SERVER_IP=$(cat PIA_SERVER_IP)
PIA_WG_CN=$(cat PIA_WG_CN)
Joined: 16 Nov 2015 Posts: 6436 Location: UK, London, just across the river..
Posted: Mon Oct 18, 2021 4:34 Post subject:
i guess you did make it executable ??
code:
chmod +x script path
and where exactly it should store its stuff in opt?
apart of tmp that doesn't survive reboot and opt that is on usb and survives reboot the other fs is ready only…. _________________ Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
Last edited by Alozaros on Mon Oct 18, 2021 7:43; edited 1 time in total
no it was the lack of PATH for the binaries jq (and base64 in another script) I use in /opt/bin. Added the line
Code:
export PATH=$PATH:/opt/bin
to fix it. I was trying to get a cron job with another script 'connect.sh' to work and it wouldn't so I searched and found you can output a cron job to a txt file. For this I used after the cron timer
. This showed me the error in that txt file. Searching here found that cron and presumable startup don't share the same PATH as telnet. I used
Code:
echo $PATH
to see the cron PATH '/usr/bin:/bin:/sbin:/usr/sbin:/jffs/sbin:/jffs/bin:/jffs/usr/bin:/jffs/usr/sbin' which is quite limited compared to telnet's '/bin:/usr/bin:/sbin:/usr/sbin:/jffs/sbin:/jffs/bin:/jffs/usr/sbin:/jffs/usr/bin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin'. I am surprised all those are needed when /opt/bin is where every installed package goes and that the other path doesn't have that added. Kind of a stupid lack of a feature.
Would be nice if the syslog showed the script outputs and errors too.