UPnP-Hack icon indicating copy to clipboard operation
UPnP-Hack copied to clipboard

Command output parsing bug

Open eyosias-k-negash opened this issue 2 years ago • 0 comments

It does not send the UPnP discovery packet because the command to parse the IP address of the target interface fails. Probably because of changes made to the output format of ifconfig.

I did not want to clone the repo so here is a shallow fix. add a sed filter to the command pipe to strip the whitespace in front. before:

5: get_ip = lambda(x): os.popen('ifconfig {0} | grep -e "inet\ " | cut -d" " -f2'.format(x)).read().strip()

after :

5: get_ip = lambda(x): os.popen('ifconfig {0} | grep -e "inet\ " | sed "s/^ *//g" | cut -d" " -f2'.format(x)).read().strip()

eyosias-k-negash avatar Jun 06 '22 13:06 eyosias-k-negash