Orwell's "1984" in Tomato by shibby

Discussion in 'Tomato Firmware' started by KurroHimenez85, Nov 20, 2012.

  1. rs232

    rs232 Network Guru Member

    Hi Shibby i just wanted to report than on some built this doesn't work:

    Tomato v1.28.8754 ND USB vpn3.6
    root@tomato:/tmp/home/root# /cifs1/TomatoAnon.sh
    Connecting to api.easyjquery.com (
    Connecting to tomato.groov.pl (

    Tomato v1.28.7633 .3-Toastman-VLAN-IPT-ND ND VPN
    root@unknown:/tmp/home/root# /cifs1/TomatoAnon.sh
    Connecting to api.easyjquery.com (
    Connecting to tomato.groov.pl (
    On recent builds instead (e.g. shibby AIO on Asus RT-N16) seems to be working fine:

    Tomato v1.28.0000 MIPSR2-102 K26 USB AIO
    root@tomato:/tmp/home/root# /cifs1/TomatoAnon.sh
    Connecting to api.easyjquery.com (
    Connecting to tomato.groov.pl (
    null                 100% |*******************************|   352  --:--:-- ETA
  2. dc361

    dc361 Network Guru Member

    @rs232 -- try "sh /cifs1/TomatoAnon.sh" to see if that works
  3. Mangix

    Mangix Networkin' Nut Member

    On some routers, I don't get the progress bar but it still ends up working(after verification at the site). prolly just a visual glitch.
  4. rs232

    rs232 Network Guru Member

    Thanks guys, I think the issue is another.
    sh /cifs1/TomatoAnon.sh
    didn't help, I still get the same output, also I can confirm that the output displayed is only cosmetic and does not represent anything. On one device I get no progress bar and it get registered where on another one (different built same LAN) it doesn't work.
    Just following my post above, the first one is an old TomatoVPN 3.6 (not registering) where the second one is a Shibby 0.99 (registering). They both have no progress bar.
    Perhaps the script can be modified to add a debug/verbose output to see what's going on?
  5. koitsu

    koitsu Network Guru Member

    The problem is almost certainly related to wget and the parameters being passed to it on the command-line. Older wget probably doesn't support some syntax or details, while newer does, which is why you'd see this work on newer firmwares but not older. Remember: wget is also a Busybox binary, not the "stock GNU wget that everyone is used to" -- and the Busybox version is utter crap. I even hinted at wget parameter issues in this thread already.

    Please provide the full script here (as an attachment) and I'll look at it and give you some insights to what the issue likely is.
  6. rs232

    rs232 Network Guru Member

    The script is v0.3 from Shibby's site (in attachment any ways)


    Attached Files:

  7. ytsejam

    ytsejam Network Guru Member


    I have two Netgear routers. A WNR3500L V1 and a WNR3500L V2. Both are running build 104 and both are running TomatoAnon. However, when clicking on Checkout my Router, the WNR3500L V2 reports and incorrect Uptime. The V1's uptime is correct.
  8. koitsu

    koitsu Network Guru Member

    This script looks highly breakable in many ways (assumption that every firmware this is used on has said utilities, mainly, and relies entirely on $PATH so if you have other utilities in, say, /opt/bin with the same names as those in /bin this may break things), and the one line that gets me the most is this:

            ISO=`cat /tmp/country | grep Country] | awk '{ print $3 }'`
    Note the closing bracket on the grep string, without use of proper quoting or escaping. Yes this works, but awful habit to get into. Should really be grep "Country\]" just as a precautionary measure. And there's no need for the excessive forking either -- awk can do all this by itself, saving resources. Also note the double quotes here, in case the string has spaces or other characters:

    ISO="`awk '/Country\]/ { print $3 }'`"
    The script reads fairly easily and it's obvious the "failure" happens during the wget HTTP GET phase near the end (to tomato.groov.pl, not api.easyjquery.com). It would be useful to see exactly what is in the /tmp/AnonLink file, i.e. remove the rm /tmp/AnonLink line and re-run the script then provide the contents of /tmp/AnonLink here.

    I would also try (separately) changing the hashbang line at the start to #!/bin/sh -x which will result in a very large amount of debugging output. If I could see that full output, I might be able to determine what's broken.

    Also, generally speaking, use of the -e flag in the hashbang line might help keep things under control. -e is both a blessing and a curse, but it can help catch certain situations that might bite you otherwise. But honestly tests for the existence of all the relied upon command-line utilities, along with using variables for their locations (and using fully-qualified paths, i.e. /usr/bin/wget not wget) is the best choice.
  9. Daky

    Daky Network Guru Member

    Its off for me for an hour and thats because of the first update after router is rebooted.

    It depends on what you set in options, how often to update the page (mine is set to one hour) so it must be an hour late.

    I don't think shibby has auto update right after router is rebooted (which should be there i think)
  10. El Maestro

    El Maestro Networkin' Nut Member

    Shibby, can't make it work in L2TP with the last build for the E2500 (2.4Ghz and 5Ghz). Openvpn works fine, but not L2TP. Could you please take a look? Other than that, the build is working great.

  11. rs232

    rs232 Network Guru Member

    Hi Shibby, just wondering... why is the frequency set to max 12?

  12. chaohua27

    chaohua27 Serious Server Member

    The models as FiberHome HG320, thank you!

    FiberHome HG320:
    boardtype : 0x053d
    boardnum : 0527
    boardrev : 0x1202
    boardflags: 0x710
  13. shibby20

    shibby20 Network Guru Member

    @chaohua27 - thanks. I see few unidentified routers in Anon :) And this is great to know, there are some router supported by Tomato and we even didn`t know that!!

    @rs232 - i simply take interval settings and add cru (scheduler) job:
    0 */$interval * * * <run anon script>

    this is why we can set interval between 1-12 hours :) Maybe in next release i will allow to set interval by days. We will see :)
  14. ArmoredDragoon

    ArmoredDragoon Networkin' Nut Member

    Hmm...I don't see what the hubbub is here, I can think of many other projects where the developers want the same kind of information. Cyanogenmod is a good example, because that literally follows you wherever you go. I'm not sure what they use it for exactly, but it doesn't exactly bother me that they want it. I'm a very security/privacy conscious person (I'm in the process of setting up fwknopd and a reflexive firewall right now,) but I'm also not paranoid.
  15. chaohua27

    chaohua27 Serious Server Member

  16. leandroong

    leandroong LI Guru Member

  17. chaohua27

    chaohua27 Serious Server Member

  18. duprade

    duprade Serious Server Member

    Thank you Shibby for all your hard work. Unfortunately there will always be people who have nothing else better to do than argue online and try to find "bad" in everything...and trash your good intentions.

    The solution you've presented is very good and I gladly enabled TomatoAnon on my router even before reading this thread. Keep up the good work!!
  19. ar514

    ar514 Serious Server Member

    Wanted to post here to pledge my support for shibby! You are helping to keep tomatoUSB advancing. I love this project and the idea of having an online database of router stats can be a great idea for the community. Please keep up the good work shibby! I wanna shout out to toastman and the other people working on their own versions, great job!
    Techie007 likes this.
  20. Edrikk

    Edrikk Network Guru Member

    +1 for Shibby's great work.
    He's definitely (in my opinion) leading an important 'prong' of Tomato's advancement...
    Way to go Shibby!
    Techie007 likes this.
  21. ghoffman

    ghoffman LI Guru Member

    @shibby -
    i acquired a router (e4200v1) from a colleague in (ES), but the tomatoanon database does not update for this router. i flashed a new (US) cfe in it with the original MAC addresses - so when i click the 'see my router' link on my tomatoanon page, it correctly finds the router - but only shows that it was last updated from (ES) a few months ago. i've got it set to update every 6 hours, and resetting/reflashing makes no difference.
    does you tomatoanon database have some security check that would prevent my router from updating itself given these details?
  22. tomatosoup

    tomatosoup Networkin' Nut Member

    Same (or similiar) problem on my E4200 - I guess the problem is related due to missing escapes (see koitsu's post above).

    On my E4200, the wget-call results in a 404:
    Connecting to tomato.groov.pl (
    null                100% |******************************************************************************************************************************|  404  0:00:00 ETA
    Login via SSH/Telnet and do
    sh -x /usr/sbin/tomatoanon
    and see what happens...
  23. ghoffman

    ghoffman LI Guru Member

    @tomatosoup -
    that worked! (i ran it from system/tools/)
    thank you.
  24. w11x22

    w11x22 Networkin' Nut Member

    I would support Shiiby on this as he, at least, informed everybody before doing this and also you have the option to disable it. Not everyone knows Linux or the programing, I have no idea what is running in the back ground on these ROuters but I trust these guys and download and install differnet FMs. What if you download any other FM and some nasty script tunning in the back ground. Person like me would never know. But Shibby announced in public and gave the optioin to disable it. I disabled it for a month or so then I enabled it 'cause I trust these FMs and people who develoed it, support it and continue to support it. Hats off to all who put so much time and effort to build and maintain these FMs. I do not know why people Whine and complain about this.... Come on people just dont install this FM, if you have problem. You people complaining as you guys have paid a subscription and upset now....
  25. ghoffman

    ghoffman LI Guru Member

    what determines the country code in the tomatoanon database?
    my router started as from spain. when i ran the update script (sh -x /usr/sbin/tomatoanon) two weeks ago, it correctly updated to US. this morning the database was indicating my router was in australia. when i again ran the update script, tomatoanon said my router was in france.

    my life is not that exciting!
    what is goimg on?
  26. leandroong

    leandroong LI Guru Member

    Me too. I was in Poland. Check tomato site and indeed was not listed in my country. This is a bug.
    + echo http://tomato.groov.pl/tomatoanon.php?wanmac_md5=c994cada65cef1713dbd84b83990bdcf&model=ZTE ZXV10 H618B&version=109 K26 USB&buildtype=AIO&country=Poland  &flag=PL&driver= 2:13&mod=Shibby&anon=1
    I only got that country error when I try running tomatoanon script. When I reboot my router. My router is detected on proper country list.

    sh -x /usr/sbin/tomatoanon
  27. ghoffman

    ghoffman LI Guru Member

    leandroong - the behavior is different for my router. the first time i ran the script (weeks ago) it got me to the correct country (usa). i have since rebooted my router a number of times and ended up in australia. after i ran the script today, i was in france.
  28. leandroong

    leandroong LI Guru Member

    @ghoffman, did you set your location in Basic->Time correctly?
  29. ghoffman

    ghoffman LI Guru Member

    yes. gmt -6
  30. ghoffman

    ghoffman LI Guru Member

    and now i'm in poland!
  31. leandroong

    leandroong LI Guru Member

    I only get that weird country problem, if I run that tomatoanon script that you mention.
  32. leandroong

    leandroong LI Guru Member

    Maybe that is not the update script that my router is using.
  33. shibby20

    shibby20 Network Guru Member

  34. RMerlin

    RMerlin Network Guru Member

    You could use GeoIP on your server to do the lookups yourself.
  35. ghoffman

    ghoffman LI Guru Member

    shibby - did you change something?
    for a moment i was back in the usa without a reboot or script run. but now i'm back in poland.

    this is only on my e4200v1. all my other routers report correctly...
  36. ghoffman

    ghoffman LI Guru Member

    shibby - is your tomoatoanon script available for use on other firmwares?
    i could not find it at update.groov.pl

  37. kthaddock

    kthaddock Network Guru Member

  38. ghoffman

    ghoffman LI Guru Member

    @kthaddock - thank you.
    i put this script in a local directory, but when i run this
    sh /jffs/tomatoanon.sh
    on a victek build an a belkin sharemax 300, i get script errors. (line 51, else error; fi expected)

    any suggestion for a command to be run in scheduler that might work?
  39. leandroong

    leandroong LI Guru Member

    Probably, error due to end of line issue. Use notepad++ to check and correct.
  40. ghoffman

    ghoffman LI Guru Member

    not an eol issue afaik, but i'll keep working. thanks.
  41. shibby20

    shibby20 Network Guru Member

    without modification it will not works because Anon works only if it`s enabled (it checks two nvram variables):
    But i propably will turn off Anon for few weeks. It generate too much load on my VPS.
    I want to leave only "tomato update notification system"
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice