What's new

[R7800, R9000 & probably others] Blocklist based Firewall addon

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

@KW. it did say 'y'. :)
 
Nothing happend what i could see-
Code:
echo -n "say y: "; A=$(head -n1); echo $A                                                  
  say y: y          
root@R9000:/$

This is such a struggle, .
R7800 and R9000 are so different here. This is such a simple thing (ask user input).
Correct output should be :
Code:
Say y: y
Answer: y

Here are more to try:
Code:
read -r -p 'Say y: ' A; echo "Answer: $A"
Code:
read -r -p 'Say y: ' A>/dev/null; echo "Answer: $A"
Code:
echo -n 'Say y: '; A=$(head -c1); echo "Answer: $A"
 
:(Actually the R7800 behaves the same as the R9000. :eek:
Maybe you are not aware of some entware or busybox fix you have.
Code:
root@R7800:/$ type read
read is a shell builtin

This behaviour is from stock and has been as long as I have coded the R7800.
It also persisted when Voxel updated to latest greatest build-chain.

:cool:I had to use a /dev/tty trick to get it working as I wanted.:D
PS
I'm not at home and can not post my solution. But I'm sure @Voxel have one too!
This is such a struggle, .
R7800 and R9000 are so different here.
 
L&LD You're right! It's time to ask the Voxel firmware the meaning of life.

Command 1

Code:
root@R9000:/$ read -r -p 'Say y: ' A; echo "Answer: $A"                                                                 
Say y: y                             
Answer:                                                                                                               
 root@R9000:/$ y                                                                   
/bin/ash: y: not found

Command 2

Code:
read -r -p 'Say y: ' A>/dev/null; echo "Answer: $A"                                                       
Say y: y   
 Answer:                                                                                                                 
root@R9000:/$ y                                                                                                         
/bin/ash: y: not found

Command 3

Code:
echo -n 'Say y: '; A=$(head -c1); echo "Answer: $A"                             
 Say y: y 
 Answer:
root@R9000:/$
 
:(Actually the R7800 behaves the same as the R9000. :eek:
Maybe you are not aware of some entware or busybox fix you have.
Code:
root@R7800:/$ type read
read is a shell builtin

This behaviour is from stock and has been as long as I have coded the R7800.
It also persisted when Voxel updated to latest greatest build-chain.

:cool:I had to use a /dev/tty trick to get it working as I wanted.:D
PS
I'm not at home and can not post my solution. But I'm sure @Voxel have one too!
Strange!
Apparently, other users of R7800 are not experiencing this problem!??
But as you pointed out, read is directly in ash, and I tried this:
Code:
root@HERMES:~$ /bin/busybox ash


BusyBox v1.4.2 (2020-04-22 16:03:24 UTC) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

root@HERMES:~$ read A; echo $A
test
test
I have installed no fixes on the rootfs, certainly not changed busybox ash...
So what is going on here?
 
Maybe with stty?
Mine is:
Code:
root@HERMES:~$ stty -a
speed 38400 baud; rows 18; columns 113; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>;
start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc

@KW. : could you try this command and post output (sorry to ask you again...)
Code:
stty at
 
  • Like
Reactions: KW.
Dont be sorry I think this is fun just send whatever pops up in your mind.

Code:
root@R9000:/$ stty at                                                                         
 /bin/ash: stty: not found                                                       
 root@R9000:/$
 
Dont be sorry I think this is fun just send whatever pops up in your mind.

Code:
root@R9000:/$ stty at                                                                       
 /bin/ash: stty: not found                                                     
 root@R9000:/$

Sorry, I meant
Code:
stty -a
Apparently, autocorrect wants to pop things of its own lol
 
test is a command, thats why it seems to be working. You should answer with y or n :oops:
Your code reads a command and then (tries to) execute it.
Code:
type test
Strange!
Apparently, other users of R7800 are not experiencing this problem!??
But as you pointed out, read is directly in ash, and I tried this:
Code:
root@HERMES:~$ /bin/busybox ash


BusyBox v1.4.2 (2020-04-22 16:03:24 UTC) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

root@HERMES:~$ read A; echo $A
test
test
I have installed no fixes on the rootfs, certainly not changed busybox ash...
So what is going on here?
 
test is a command, thats why it seems to be working. You should answer with y or n :oops:
Your code reads a command and then (tries to) execute it.
Code:
type test
Code:
root@HERMES:~$ /bin/busybox ash


BusyBox v1.4.2 (2020-04-22 16:03:24 UTC) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

root@HERMES:~$ read A
gheuhfehf
root@HERMES:~$ echo $A
gheuhfehf
root@HERMES:~$
 
I remember the R7800 doesn't have "stty".
Again, I think your entware or something else is playing you tricks.
Did you run
Code:
type read

Maybe with stty?
Mine is:
Code:
root@HERMES:~$ stty -a
speed 38400 baud; rows 18; columns 113; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>;
start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc
 
I remember the R7800 doesn't have "stty".
Again, I think your entware or something else is playing you tricks.
Did you run
Code:
type read
Yep:
Code:
root@HERMES:~$ type read
read is a shell builtin
 
I think I have a pretty good "manual" for entware install, since I've prepared it's installation as an add-on.
What was your problem(s)? You must become friends with entware soon :cool:
R. Gerrits Dont mention entware! That "#"#¤ almost made me throw the router in the wall last night when i tried to get it working but could not do it:)
 
Again, I think your entware or something else is playing you tricks.
That is probably the case, but I don’t see how... This is very tricky...
 
Maybe time for another thread about this "read" command thing ?!
As I remember the R7800 read has no -n support, so it reads until cr is pressed.
 
@kamoj Do you want me to test these commands?

About the entware i think the problem is that I dont know what the problem is... But my goal has been to get iprange for this blocklist firewall.

I know stty is part of kwilt. Entware not needed... I used it before.
Can you run these commands:
Code:
find / -name tty
find / -name stty

PS
Don't mention I used kwilt to Voxel :oops:
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top