kamoj
Very Senior Member
You can remove your USB devices and reboot without entware?
That is probably the case, but I don’t see how... This is very tricky...
That is probably the case, but I don’t see how... This is very tricky...
find / -name tty
/dev/tty
/overlay/opt/bin/tty
/overlay/hipplay/usr/bin/tty
/proc/tty
find: /proc/5126/task/5126/fdinfo/5: No such file or directory
/rom/dev/tty
/sys/devices/soc.0/fd883000.uart0/tty
/sys/devices/soc.0/fd884000.uart1/tty
/sys/devices/virtual/tty
/sys/devices/virtual/tty/tty
/sys/devices/platform/serial8250/tty
/sys/class/tty
/sys/class/tty/tty
find / -name stty
/overlay/opt/bin/stty
/overlay/hipplay/bin/stty
find: /proc/32230: No such file or directory
Yes, I was thinking of doing that... Just can’t disrupt internet now... Maybe tomorrow morning.You can remove your USB devices and reboot without entware?
root@HERMES:~$ find / -name tty
/dev/tty
/proc/tty
/sys/devices/virtual/tty
/sys/devices/virtual/tty/tty
/sys/devices/platform/msm_serial_hsl.1/tty
/sys/devices/platform/serial8250/tty
/sys/class/tty
/sys/class/tty/tty
/tmp/mnt/sda1/entware/bin/tty
root@HERMES:~$ find / -name stty
/tmp/mnt/sda1/entware/bin/stty
root@HERMES:~$
echo -n "say y: "; echo "answer: $(head -c1 /dev/tty)"
echo -n "say y: "; A=$(dd ibs=1 count=1 2>/dev/null); echo -e "\nanswer: $A"
echo -n "say y: "; echo "answer: $(head -c1 /dev/tty)"
say y: y
answer:
echo -n "say y: "; A=$(dd ibs=1 count=1 2>/dev/null); echo -e "\nanswer: $A"
say y: y
answer:
root@R9000:/$ y
/bin/ash: y: not found
Here it is. Dont worry about throwing out commands you want to try. I like to play with the big guys
Command 1
Code:echo -n "say y: "; echo "answer: $(head -c1 /dev/tty)" say y: y answer:
Command 2
Code:echo -n "say y: "; A=$(dd ibs=1 count=1 2>/dev/null); echo -e "\nanswer: $A" say y: y answer: root@R9000:/$ y /bin/ash: y: not found
Q="Do you want to uninstall the kamoj add-on? "; echo -n "$Q"
ANSWER="$(i=0;while [ $i -lt 2 ];do i=$((i+1));read -p "" yn </dev/tty;[ -n "$yn" ] && echo -n "$yn" && break;done)"
echo "$ANSWER"
echo -n "say y: "; case "$(i=0;while [ $i -lt 2 ];do i=$((i+1));read -p "" yn </dev/tty;[ -n "$yn" ] && echo "$yn" && break;done)" in Y|y|yes|Yes|YES) echo 'answer is YES';; *) echo 'answer is NO';; esac
Ok, back and found it.
Apart from this there is also a trick involving sed and tty...
I don't think you need any instruction, so here is my current solution (one of many):
Code:Q="Do you want to uninstall the kamoj add-on? "; echo -n "$Q" ANSWER="$(i=0;while [ $i -lt 2 ];do i=$((i+1));read -p "" yn </dev/tty;[ -n "$yn" ] && echo -n "$yn" && break;done)" echo "$ANSWER"
echo -n "say y: "; case "$(i=0;while [ $i -lt 2 ];do i=$((i+1));read -p "" yn </dev/tty;[ -n "$yn" ] && echo "$yn" && break;done)" in Y|y|yes|Yes|YES) echo 'answer is YES';; *) echo 'answer is NO';; esac
Greatsorry. missed a line:
Code:say y: y answer is YES
v3.2.2![]()
/opt/bolemo/scripts/firewall-blocklist clean
iptables v1.4.21: mark: bad mark value for option "--mark", or out of range.
Try `iptables -h' or 'iptables --help' for more information.
grep: xregcomp: Unmatched [ or [^
root@R9000:/$
Info:
- The script is properly installed.
- firewall-blocklist version: v3.2.2
- This is the last version.
- iprange is not installed.
rm -r fbl
rm: descend into directory 'fbl'? y
root@R9000:/tmp/mnt/sdb1$
Status:
- firewall-blocklist version: v3.2.2
- iprange is not installed.
- Firewall blocklist is set and active.
- Filtering 619977398 IP adresses.
Logging is off.
/opt/bolemo/scripts/firewall-blocklist update -v
firewall-blocklist v3.2.2 - Verbose mode
Initializing...
- /opt/scripts/firewall-start.sh was edited and is now ok.
Updating blocklist from sources...
- Downloading lists defined in /opt/bolemo/etc/firewall-blocklist.sources
1) https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/firehol_level1.netset
- 100%[===================>] 38.90K --.-KB/s in 0.004s
2) https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/firehol_level2.netset
- 100%[===================>] 273.25K --.-KB/s in 0.04s
3) https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/firehol_level3.netset -
100%[===================>] 258.12K --.-KB/s in 0.03s
4) https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/iblocklist_ciarmy_malicious.netset
-
100%[===================>] 202.70K --.-KB/s in 0.02s
5) https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/malwaredomainlist.ipset -
100%[===================>] 14.49K --.-KB/s in 0.002s - iprange not installed, passing optimization and reduction process.
- Removing duplicates...
- Done.
Building ipset blocklist (44959 entries blocking 619977398 ips)...
- Created blocklist.
- Done.
Restarting firewall...
iptables v1.4.21: mark: bad mark value for option "--mark", or out of range.
Try `iptables -h' or 'iptables --help' for more information.
grep: xregcomp: Unmatched [ or [^
- Built-in firewall restarted.
Status:
- firewall-blocklist version: v3.2.2
- iprange is not installed.
- Firewall blocklist is set and active.
- Filtering 619977398 IP adresses.
- Logging is off.
Detailed status:
- /opt/scripts/firewall-start.sh exists with correct settings.
- Actual router time: Sun May 3 18:18:42 UTC 2020
- Blocklist generation time: Sun May 3 18:18:42 UTC 2020
- Router firewall was last started Sun May 3 18:18:43 UTC 2020:
ipset blocklist was already loaded and was kept.
blocklist rules were added to iptables.
- iptables rules are set:
iptables -N FwBl_DROP
iptables -A INPUT -i brwan -m set --match-set FwBl_BL src -j FwBl_DROP
iptables -A FORWARD -i brwan -m set --match-set FwBl_BL src -j FwBl_DROP
iptables -A FORWARD -o brwan -m set --match-set FwBl_BL dst -j FwBl_DROP
iptables -A OUTPUT -o brwan -m set --match-set FwBl_BL dst -j FwBl_DROP
iptables -A FwBl_DROP -j DROP
- Logging is inactive.
- ipset filter (blocklist) is set:
Name: FwBl_BL
Type: hash:net
Revision: 6
Header: family inet hashsize 32768 maxelem 65536
Size in memory: 1396788
References: 4
Number of entries: 44959
- ipset bypass (whitelist) is not set.
For info, this iptables error you get is not coming for the script. Apparently, native NG setups are throwing some errors (likely to be without incidence because all routers sold are concerned).Fantastic! Here is my report of the update.
Befor the update running the clean command:
Code:/opt/bolemo/scripts/firewall-blocklist clean iptables v1.4.21: mark: bad mark value for option "--mark", or out of range. Try `iptables -h' or 'iptables --help' for more information. grep: xregcomp: Unmatched [ or [^ root@R9000:/$
Interesting. Did it do that before?After installation:
Code:Info: - The script is properly installed. - firewall-blocklist version: v3.2.2 - This is the last version. - iprange is not installed.
rm -r fbl command didnt work
Code:rm -r fbl rm: descend into directory 'fbl'? y root@R9000:/tmp/mnt/sdb1$
cd /mnt/optware
rm -rf fbl
Status:
Code:Status: - firewall-blocklist version: v3.2.2 - iprange is not installed. - Firewall blocklist is set and active. - Filtering 619977398 IP adresses. Logging is off.
Code:/opt/bolemo/scripts/firewall-blocklist update -v firewall-blocklist v3.2.2 - Verbose mode Initializing... - /opt/scripts/firewall-start.sh was edited and is now ok. Updating blocklist from sources... - Downloading lists defined in /opt/bolemo/etc/firewall-blocklist.sources 1) https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/firehol_level1.netset - 100%[===================>] 38.90K --.-KB/s in 0.004s 2) https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/firehol_level2.netset - 100%[===================>] 273.25K --.-KB/s in 0.04s 3) https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/firehol_level3.netset - 100%[===================>] 258.12K --.-KB/s in 0.03s 4) https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/iblocklist_ciarmy_malicious.netset - 100%[===================>] 202.70K --.-KB/s in 0.02s 5) https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/malwaredomainlist.ipset - 100%[===================>] 14.49K --.-KB/s in 0.002s - iprange not installed, passing optimization and reduction process. - Removing duplicates... - Done. Building ipset blocklist (44959 entries blocking 619977398 ips)... - Created blocklist. - Done. Restarting firewall... iptables v1.4.21: mark: bad mark value for option "--mark", or out of range. Try `iptables -h' or 'iptables --help' for more information. grep: xregcomp: Unmatched [ or [^ - Built-in firewall restarted. Status: - firewall-blocklist version: v3.2.2 - iprange is not installed. - Firewall blocklist is set and active. - Filtering 619977398 IP adresses. - Logging is off. Detailed status: - /opt/scripts/firewall-start.sh exists with correct settings. - Actual router time: Sun May 3 18:18:42 UTC 2020 - Blocklist generation time: Sun May 3 18:18:42 UTC 2020 - Router firewall was last started Sun May 3 18:18:43 UTC 2020: ipset blocklist was already loaded and was kept. blocklist rules were added to iptables. - iptables rules are set: iptables -N FwBl_DROP iptables -A INPUT -i brwan -m set --match-set FwBl_BL src -j FwBl_DROP iptables -A FORWARD -i brwan -m set --match-set FwBl_BL src -j FwBl_DROP iptables -A FORWARD -o brwan -m set --match-set FwBl_BL dst -j FwBl_DROP iptables -A OUTPUT -o brwan -m set --match-set FwBl_BL dst -j FwBl_DROP iptables -A FwBl_DROP -j DROP - Logging is inactive. - ipset filter (blocklist) is set: Name: FwBl_BL Type: hash:net Revision: 6 Header: family inet hashsize 32768 maxelem 65536 Size in memory: 1396788 References: 4 Number of entries: 44959 - ipset bypass (whitelist) is not set.
The blocklist works very fine and as before I notice no drawbacks on my networks performance. All i got with your script is a safer networkNow on my wish list is the iprange. I hope it is possible to get in the script for r9000 sometime in the future.
Your script is here to stay thank you allot for sharing it!

Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!