frankthetank7254 / feral

4 stars 13 forks source link

stuck on "Waiting for route change to take effect" #14

Open geransmith opened 8 years ago

geransmith commented 8 years ago

I am running hits on my router using entware. It looks like the script is getting stuck on line 115.

    while [ $route_set = 1 ]; do
    route_set=$(curl -4 -s "https://network.feral.io/looking-glass?action=traceroute&host=$ext_IP" | grep -c "$old_route")
    done

I manually added some echos for those variables, and it looks like route_set is not getting set properly. I then ran the curl and grep commands manually with the variables filled in properly. It looks like grep returns the expected 0 value (so the script can move on), BUT, curl then outputs additional text, clobbering the results. Essentially it looks like this:

admin@router:/tmp/home/root# curl -4 -s https://network.feral.io/looking-glass?action=traceroute&host=99.99.99.99 | grep -c "77.67.64.81"
0
admin@router:/tmp/home/root# <!DOCTYPE html>
<html lang="en-GB">
    <head>
        <title>Looking Glass - network.feral.io</title>
        <link rel="stylesheet" type="text/css" media="all" href="/css/reset.css">
        <link rel="stylesheet" type="text/css" media="all" href="/css/network.feral.io.css">

    </head>

I did some Googling and was trying to see if someone else had run into curl being strange. In some futile attempts to fix this, I was able to workaround it by adding a syntax error to curl. Curl continued to run as expected, but reported a warning message.. That was apparently enough for it to continue on in the rest of the script though.

frankthetank7254 commented 8 years ago

i could probably put in another check in there to ensure that the step actually does what it is supposed to do... It is a bit of a weird check to begin with... I will try to come up with a better method. I have been busy lately, but I will let you know if i come up with something...

geransmith commented 8 years ago

It seems like it is more with how curl is returning information. It is clobbering the rest of the output. I will try and tinker with it a bit to see if I can find a way to code around it.