What's new

AB-Solution 2.0 is out! (v2.0.1)

  • 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!

My AB-Solution stopped working :(

I originally had a single 8gb USB2 stick that I had this running from and all was good, I then went to add a 1TB USB drive as storage but the two didn't like each other so I had to remove 8gb USB2 stick in favour of the 1TB USB drive formatted as EXT4.

Got the drive working with files, FTP etc. and then went to re-install AB-Solution, it ran the install script fine, didn't complain said it was installing to the 1TB USB drive and everything looked good.

I noticed though that I was still getting ads that I hadn't been when it was running, all the options looked good in the menu so when to follow the log file with option 2 but get "tail: can't open '/tmp/mnt/Samsung/adblocking/logs/dnsmasq.log': No such file or directory" and if I browse to that directory aside from the install log it is empty.
 
Last edited:
Ok ignore that, by uninstalling and blowing away any left over files etc. then a reinstall it seems to work and has created the logs etc. :)
 
Ah, got it. The built in script installs entware-ng as well, but to the /entware directory, so it isn't that that is the problem, but that's why we have different scripts.

Ahh right ok, that makes sense.

Right so I have edited my script which I will try out now as below.

''
#!/bin/sh

if [ "$1" = "/tmp/mnt/2GB" ] ; then
ln -nsf $1/entware-ng.arm /tmp/opt
/opt/etc/init.d/rc.unslung
fi

sleep 2
if [ -f /opt/swap ]
then
echo -e "Mounting swap file..."
swapon /opt/swap
else
echo -e "Swap file not found or /opt is not mounted..."
fi

# DO NOT EDIT THIS MANUALLY. But, you may edit above.
# This version and future versions of AB-Solution depend on it to be unaltered.
# More entries may be added by AB-Solution dynamically when changing services.
# You have been warned.
# generated by AB-Solution 2.0.1
if [ -d "/tmp/mnt/2GB" ];then
service restart_dnsmasq
logger "AB-Solution added entries via post-mount"
ln -s /tmp/mnt/2GB/ab-solution.sh /home/root/ab-solution.sh
fi
# end of DO NOT EDIT. And you may edit below as well.
''
 
Odd issue on my N66U - I'm not able to connect to hotmail.com because I can't get to their authentication site so I added the entries to the whitelist.txt file and did a [p]. Connection was still being blocked. Also continues to block even after a reboot. If I disable AB then I'm able to connect just fine. Re-enabling AB and the problem continues. This shows that the entry is not in hosts-adblock:

admin@--:/tmp/mnt/FLASHDRIVE/adblocking# grep login.live.com *
blacklist.txt:0.0.0.0 login.live.com
blacklist.txt:0.0.0.0 login.live.com.nsatc.net
whitelist.txt:login.live.com
whitelist.txt:login.live.com.nsatc.net

admin@--:/tmp/mnt/FLASHDRIVE/adblocking# ping login.live.com
PING login.live.com (0.0.0.0): 56 data bytes
64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.274 ms
64 bytes from 127.0.0.1: seq=1 ttl=64 time=0.265 ms

admin@--:/tmp/home/root# ping hotmail.com
PING hotmail.com (65.55.77.28): 56 data bytes
64 bytes from 65.55.77.28: seq=0 ttl=235 time=55.983 ms

Using the "shooter40sw" file. I'm out of ideas of what to try next. Thanks!

AB-Solution is up to date!

ab-solution.sh: 2.0.1 (latest version)
update-hosts.sh: 1.4 (latest version)
log-stats.sh: 1.1 (latest version)
It doesn't work quite like that. Whitelist.txt removes matching lines from hosts-adblock. Blacklist.txt is added as an additional set of blocks. So the blacklist.txt lines work even if the whitelist lines remove those sites from hosts-adblock.

When you ping login.live.com, it is still directing to the router itself, blocking it.

Remove those lines from blacklist.txt and try it.
 
Ahh right ok, that makes sense.

Right so I have edited my script which I will try out now as below.

''
#!/bin/sh

if [ "$1" = "/tmp/mnt/2GB" ] ; then
ln -nsf $1/entware-ng.arm /tmp/opt
/opt/etc/init.d/rc.unslung
fi

sleep 2
if [ -f /opt/swap ]
then
echo -e "Mounting swap file..."
swapon /opt/swap
else
echo -e "Swap file not found or /opt is not mounted..."
fi

# DO NOT EDIT THIS MANUALLY. But, you may edit above.
# This version and future versions of AB-Solution depend on it to be unaltered.
# More entries may be added by AB-Solution dynamically when changing services.
# You have been warned.
# generated by AB-Solution 2.0.1
if [ -d "/tmp/mnt/2GB" ];then
service restart_dnsmasq
logger "AB-Solution added entries via post-mount"
ln -s /tmp/mnt/2GB/ab-solution.sh /home/root/ab-solution.sh
fi
# end of DO NOT EDIT. And you may edit below as well.
''

Hmm the above script still did not seem to do it, does anything look wrong ?
 
Seems like it should work ....... not sure about the necessity for "/opt/etc/init.d/rc.unslung" because normally entware writes to services-start when installed to get itself running.
Code:
#!/bin/sh

RC='/opt/etc/init.d/rc.unslung'

i=30
until [ -x "$RC" ] ; do
  i=$(($i-1))
  if [ "$i" -lt 1 ] ; then
    logger "Could not start Entware-NG"
    exit
  fi
  sleep 5
done
$RC start

Make sure the script is called post-mount rather than some backup name and that it is executable. Did you edit the file in nano or vi ...doing it in some windows programs will make non unix line endings.
 
Hmm the above script still did not seem to do it, does anything look wrong ?
Try it with
Code:
/opt/etc/init.d/rc.unslung start
or
Code:
/opt/etc/init.d/rc.unslung restart
To tomsk's point, Entware's style is to call rc.unslung from services-start, which runs before thumb drives are mounted. So it loops for 90 seconds hoping by then the thumb drive mounts.

kvic has posted here that it is better to run it from post-mount without the loop, which is how I set up mine.

Maybe it would help to know what messages are in the syslog that make you think something isn't starting. Is it entware, or is it ab-solution?
 
When is 2.0.2 or 2.1 going to be released? Can't wait, so excited.
 
When is 2.0.2 or 2.1 going to be released? Can't wait, so excited.
I'm sure the wait for AB-Solution 2.1 to be released will be well worth for those waiting for the new features.
 
Thanks for the help guys. Will give it a go :)

I know I am looking forward to the new revision of AB-Solution. Will be great when it has the ability to detect current Entware installations.
 
It doesn't work quite like that. Whitelist.txt removes matching lines from hosts-adblock. Blacklist.txt is added as an additional set of blocks. So the blacklist.txt lines work even if the whitelist lines remove those sites from hosts-adblock.

When you ping login.live.com, it is still directing to the router itself, blocking it.

Remove those lines from blacklist.txt and try it.
Thank you for taking the time to point out my error. Your suggestion worked!
 
I can't ssh into my router because it always says the password is wrong. Anyone know why that is?

Second question: Do I actually need to leave the usb stick plugged into the router? What is it even needed for?
 
I can't ssh into my router because it always says the password is wrong. Anyone know why that is?
It is the same username and password as when you log into the router WebUI.
Second question: Do I actually need to leave the usb stick plugged into the router? What is it even needed for?
You can try...
Seriously: AB-Solution is more than the script you see when you install it.
To enable such a level of control through the AB-Solution UI some settings and files need to be placed on a device that has the capacity to do it.
 
I can't ssh into my router because it always says the password is wrong. Anyone know why that is?

Second question: Do I actually need to leave the usb stick plugged into the router? What is it even needed for?
Was it working before? .... you have to ssh into the router with the same name you used to log in to the GUI (case sensitive) .. if you didn't change it from admin and your lan is on 192.168.1.1 then you have to " ssh admin@192.168.1.1" if you changed the name to say tomsk then you "ssh tomsk@192.168.1.1" If you get something like
Code:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
5c:9b:16:56:a6:cd:11:10:3a:cd:1b:a2:91:cd:e5:1c.
Please contact your system administrator.
Add correct host key in /Users/user/.ssh/known_hosts to get rid of this message.
Offending key in /Users/user/.ssh/known_hosts:1
RSA host key for server1.example.com has changed and you have requested strict checking.
Host key verification failed.
then you have to clear the RSA fingerprint on your client machine with
Code:
ssh-keygen -R <Server IP address>
ssh-keygen -R <Server hostname>

The usb stick has to stay plugged in because thats where the ab-solution files will be installed.
 
What is the reason to use only EXT Partitions? I have an NTFS Disk connected to the Router (because of data exchange with Windows PC) and want to use it for ab-solutions, otherwise i have to do a lot work to change the filesystem.
 
I did use the same username and password I always use for logging into the router itself. For some reason it didn't work, I tried it a few more times, still didn't work. Then I tried it again with the exact same login data and now everything is fine. No idea what happened there.

Either way, thanks a lot for the help and for the effort of creating this, good job!
 
I did use the same username and password I always use for logging into the router itself. For some reason it didn't work, I tried it a few more times, still didn't work. Then I tried it again with the exact same login data and now everything is fine. No idea what happened there.

Either way, thanks a lot for the help and for the effort of creating this, good job!
gotta watch that CAPSLOCK :p (j/k), glad your sorted.
 
What is the reason to use only EXT Partitions? I have an NTFS Disk connected to the Router (because of data exchange with Windows PC) and want to use it for ab-solutions, otherwise i have to do a lot work to change the filesystem.
Because the router runs an operating system that is based on UNIX/Linux.
AB-Solution uses file permissions and system commands that require the file system to be in the same format.

And as I have more interesting stuff to come up my sleeves, this gets even more important in future versions.
 
Do you have manually assigned the IP's? Either the devices switch between the two or the Samsung is extremlely noisy with it's broadcasting. I'll have to fire up mine sometime to check it. The TV is more dust collector than entertainment center here. We all have other things to do.
Hi! Sorry for the late reply! I was actually reporting was it seems to me like a bug.

Steps to reproduce:
  1. Have 2 devices on your LAN, one with last octet ending in .ab and the second, .abc ("a" and "b" are the same single digit in both)
  2. Browse some sites with both devices, different sites
  3. Get the stats for dnsmasq, you will see that those sites you browsed in device .abc also shows under .ab incorrectly.
My scripting skills are quite poor and I have not even looked at the innings of your script but it seems AB-S is filtering dnsmasq.log to produce the stats and when it filters by ip address that might bring up unwanted entries, maybe adding a blank space to the end of the filter string might suffice? That would prevent .abc entries from being filtered when .ab is required.

Regards,

S
 
Hi! Sorry for the late reply! I was actually reporting was it seems to me like a bug.

Steps to reproduce:
  1. Have 2 devices on your LAN, one with last octet ending in .ab and the second, .abc ("a" and "b" are the same single digit in both)
  2. Browse some sites with both devices, different sites
  3. Get the stats for dnsmasq, you will see that those sites you browsed in device .abc also shows under .ab incorrectly.
My scripting skills are quite poor and I have not even looked at the innings of your script but it seems AB-S is filtering dnsmasq.log to produce the stats and when it filters by ip address that might bring up unwanted entries, maybe adding a blank space to the end of the filter string might suffice? That would prevent .abc entries from being filtered when .ab is required.

Regards,

S
Thanks for the detailed reporting, I'll look into it when time permits.
I consider this low priority at the moment.
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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