This would trim off the last octet for 192.168.10.100, giving me:192.168.10.

but I need this to be universal enough to handle any class of IP address...say a class A IP of 10.100.15.10? This line would give me:10.100.15.1

I still need that last "1" trimmed. I am sure there is a better way to do this, so I don't have to modify the script itself each and every time I need to do this task.

btw...if anyone was wondering why I am removing the loopback, or why it is even coming up at all...this is the only way I could figure out how to get just the static IP from the ifconfig. If there a better way for that, then I am all ears (ps...I tried using hostname -i, but when this script runs, the hosts file isn't set up yet and this defaults to the loopback).

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum