Page 1 of 1

Display Public IP address under system load info

Posted: June 25th, 2014, 3:53 pm
by toprunner2786
I apologize in advance because I am not a programmer. I currently run a headless/guiless ubuntu VM that runs SAB. It connects to the internet thru a VPN. I was wondering if someone could help me modify the SAB web page code so that I can display my public IP address underneath the system load info

something like this: "Publi IP: XXX.XXX.XXX.XXX"

This would allow me to easily check to ensure that the VPN is up and running correctly.

I am hoping that it is as easy as executing and displaying the poutput of the code below:
wget -qO- http://ipecho.net/plain ; echo

unfortunately i have no idea where or how to start this....any help?

Re: Display Public IP address under system load info

Posted: June 25th, 2014, 10:26 pm
by sander
You could put that into the value of 'p' loadavg() in sabnzbd/misc.py. See http://forums.sabnzbd.org/viewtopic.php ... oad#p71815

However, I believe that function is called on each SAB page refresh, so each few seconds. And maybe ipecho.net doesn't like that.

Pity you're not a programmer, because if you were, you could hack the below two lines into loadavg() just before the 'return p'

Code: Select all

            myip4 = urllib.urlopen('http://ipecho.net/plain').read()
            p = p + ' Public IPv4: ' + myip4

Re: Display Public IP address under system load info

Posted: June 26th, 2014, 11:22 am
by toprunner2786
I am definitely not a programmer, but I love to tinker....thanks for the tip. I will learn by trial and error....