Joined: 16 Nov 2015 Posts: 6447 Location: UK, London, just across the river..
Posted: Tue Jun 07, 2022 21:43 Post subject: [SOLVED] Save script(more than one line via SSH
Hi guys....after update R7800 to 49113...with no reset...
my ad-blocker is not loading the host list...
wc -l /tmp/dlhosts
0 /tmp/dlhosts
however on my 1043v2 with same settings its working ok...so, i would like to add more sleep time to the usb script to try...
so, i would like to be able to edit/save .rc_usb script via SSh....how do i do that...?
i already tried to
nvram set=rc_usb=/opt/etc/init.d/rc.unslung start
sleep 15
sh /tmp/.rc_custom
but while pasting it, its in 3 lines and it hangs and than the nvram value is incomplete, so how must i paste/spell it to be able to be correct value in the nvram or if there is another way...to do it??
Im not physically able to access the unit, so no GUI access..!!
Thanks in advance...!! _________________ 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
Joined: 08 May 2018 Posts: 14247 Location: Texas, USA
Posted: Tue Jun 07, 2022 21:52 Post subject:
What is the output of nvram show | grep rc_usb= on your TL-WR1043NDv2? That should give you an idea of where your mistake is or how to type it out instead of copy/paste... _________________ "Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT Pogo - A minimal level of ability is expected and needed... DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)
----------------------
Linux User #377467 counter.li.org / linuxcounter.net
Joined: 16 Nov 2015 Posts: 6447 Location: UK, London, just across the river..
Posted: Tue Jun 07, 2022 22:01 Post subject:
both the same if i go trough nvram show | grep usb=
it shows only the 1-st line
where nvram show output shows the correct 3 lines
rc_usb=/opt/etc/init.d/rc.unslung start
sleep 10
sh /tmp/.rc_custom
so, i want to change sleep to 15
what would be the correct syntax when you have 3 line's
as if i try to paste it as a 3 lines, it doesn't work it saves only the first line and the other 2 are missing
can i do it in one/single line like
nvram set=rc_usb=/opt/etc/init.d/rc.unslung start; sleep 15; sh /tmp/.rc_custom _________________ 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
Joined: 08 May 2018 Posts: 14247 Location: Texas, USA
Posted: Tue Jun 07, 2022 22:51 Post subject:
I have a feeling some magic voodoo is required, as nvram set rc_usb= should probably include information in quotation marks. I have a feeling it may not work properly as
Code:
nvram set rc_usb="/opt/etc/init.d/rc.unslung start
sleep 10
sh /tmp/.rc_custom"
Looking at the code, it removes the winblows <cr>ud from the input box in the webUI:
Joined: 16 Nov 2015 Posts: 6447 Location: UK, London, just across the river..
Posted: Tue Jun 07, 2022 23:08 Post subject:
hmm it did work 10x... exactly with double quotes...as you suggested...
so, this is the format to change the other scripts too.. custom and start up _________________ 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
Joined: 16 Nov 2015 Posts: 6447 Location: UK, London, just across the river..
Posted: Wed Jun 08, 2022 9:44 Post subject:
just to recap...
KP-69 way its working as it should...
nvram set rc_usb="/opt/etc/init.d/rc.unslung start
sleep 10
sh /tmp/.rc_custom"
than i can see the results are present in the (1043v2)GUI too (my testing unit ATM), all in the same order of 3 lines...same as the output as on nvram show
to Joker..
if you follow the thread, you will find out, my amusement that, the output of nvram show | grep rc_usb is as its supposes to be, it will show you only the first line...but not all of the rc_usb script ...
and yep that extra = in my post above was a typo
and yep your way also works and than its present in GUI and executed as it should...
nvram set rc_usb="/opt/etc/init.d/rc.unslung start; sleep 15; sh /tmp/.rc_custom"
to egc thanks, ill explore this option, i tried something similar with echo, but with no avail, now the kp-69 & Joker ways works..for me..but ill keep this in mind...thanks anyway..good to learn something new...
to ho1Aetoo yep this was my initial thought...of "forwarding the GUI via putty"...but it doesn't work as it should...as, i access via WANSSh, i have some GUI restriction rules, my GUI is via 443 local and stubby on the loopback...I need to fiddle around and redesign some rules...i guess...do i have to add an iptables line for forwarding the wanssh port to the local port..?
so far, on R7800@49113, wget is giving me an error, so in my case, i don't think usb script timing will help....
Connecting to download1.dd-wrt.com (xx.xx.x.xxx:xx)
wget: server returned error: HTTP/1.1 404 Not Found
unit works as it should, apart of wget...although i don't see any gremlins in nvram show, i need to do a reset and manual rebuild...probably, but me not present there physically to the R7800, i will wait...
wget works ok on my 1043v2 on 49113...(yep of course it will work...R7800 ISP bill not paid and they stopped port 80 http and their DNS, but im using curl(443) and DoT on this unit..so false alarm bloody GF forgot to pay the bill...girls..
i may try to use another adblocker with curl or modify the current script...
i need to fiddle around...and do some more testing... _________________ 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 Wed Jun 08, 2022 12:06; edited 2 times in total
no there must be only a port open which is forwarded to ssh
for example 22 to 22
the local port for example 8080 is created on your PC
but i use ssh on my pi hole since that supports ed25519 and access the routers from there
but this also works if you access the ssh of the router directly
Joined: 16 Nov 2015 Posts: 6447 Location: UK, London, just across the river..
Posted: Wed Jun 08, 2022 12:20 Post subject:
ho1Aetoo wrote:
no there must be only a port open which is forwarded to ssh
for example 22 to 22
the local port for example 8080 is created on your PC
but i use ssh on my pi hole since that supports ed25519 and access the routers from there
but this also works if you access the ssh of the router directly
hmmm lets say im using port 44444 for WAN ssh what i need to tunnel in putty than ?
Also if your PI supports ed25519, last time (not long ago) i also tried to add ed25519 to R7800 and it was not working, is ed25519 working now???
I do remember BS did some dropbear update to the last version, but i tried ed25519 and was not going...
if i generate a key (with puttygen) like this one, using ed25519 and paste it in R7800 GUI like that...
it was not working when i tried... how do you do that...what im missing
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOO40Ms0aFEU99IcBc0XJ23Ff9D1CLOxMqu3dnk/AgPN eddsa-key-20220408 _________________ 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
Joined: 31 Jul 2021 Posts: 2146 Location: All over YOUR webs
Posted: Wed Jun 08, 2022 15:37 Post subject:
Alozaros wrote:
just to recap...
KP-69 way its working as it should...
nvram set rc_usb="/opt/etc/init.d/rc.unslung start
sleep 10
sh /tmp/.rc_custom"
than i can see the results are present in the (1043v2)GUI too (my testing unit ATM), all in the same order of 3 lines...same as the output as on nvram show
to Joker..
if you follow the thread, you will find out, my amusement that, the output of nvram show | grep rc_usb is as its supposes to be, it will show you only the first line...but not all of the rc_usb script ...
and yep that extra = in my post above was a typo
and yep your way also works and than its present in GUI and executed as it should...
nvram set rc_usb="/opt/etc/init.d/rc.unslung start; sleep 15; sh /tmp/.rc_custom"
Your amusement as you noted is due your choices(you forget this is Linux?), 1) because you were not adding the "" to envelop the lot, and 2) because you decided to make the job harder by making it all in separate lines after following the advice to enclose the lot in "" You found out the long way around, how to get there, and getting there is all it matters, this isnt a race. (having said that race thing immediately thought "The Rat Race" Movie with Mr Bean Or RoeRow to his friends.
I configure my router via CLI in fact using a script these days and in fact it is along the lines of what egc suggested using variable, except, I dont recommend using variables for instance in startup commands/firewall scripts or any other scripts stored to nvram, because it add extra size without actually being all that useful, one liners are better where every byte matters, in fact you dont need spaces after the delimiters `;` so less is more.
But scripting in general works better with settings variables and functions, because it is more flexible, depending on the end case.
Glad you sorted it, so today you learned something new, just think what you may learn tomorrow I also learned something new, that Lighthtpd.asp/HLighthtpd.asp are a DD-WRT mystery.