Go Back   openSUSE Forums > Archives > SF Archives > ARCHIVES - Tips, Tricks & Tweaks
Forums FAQ Members List Search Today's Posts Mark Forums Read


ARCHIVES - Tips, Tricks & Tweaks Tips and Solutions for SUSE Linux
(Please do not post questions here)

 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 18-Dec-2007, 04:59
WJM
Guest
 
Posts: n/a
Default

For those of us missing the ipconfig tool as used in windows here's a little bash script to display the wanted configuration (always miss the quick display of my ip settings).

Create a file called ipconfig in the /bin directory paste the script into it and make the file executable...

Hope you find it useful.

---------------------begin here

#!/bin/bash
clear
echo '--------------------------------------------------'
echo
echo '* IP Addresses on Ethernet interfaces:'
/sbin/ifconfig | grep -A1 eth

echo
echo '* Name Servers:'
cat /etc/resolv.conf | grep name | grep -v '#'

echo
echo -n '* '
route | grep default
echo ' gateway '

echo
echo '* Other routes: '
route | grep -vi 'kernel ip routing table' | grep -vi default
echo

end here---------

edit: small cleanup
  #2 (permalink)  
Old 18-Dec-2007, 06:18
Snakedriver
Guest
 
Posts: n/a
Default

Try:
"man ifconfig"
"man iwconfig"
for tools like "ifconfig -a"; plain old "iwconfig"; and all the power that goes with them.
  #3 (permalink)  
Old 18-Dec-2007, 06:45
WJM
Guest
 
Posts: n/a
Default

Quote:
Try:
"man ifconfig"
"man iwconfig"
for tools like "ifconfig -a"; plain old "iwconfig"; and all the power that goes with them.
[/b]
Thanks Snakedriver,

There is much power in those tools ...but its a little too much if you want to see your basic settings... also i[f-w]config don't report back name servers or route as far as I know?

  #4 (permalink)  
Old 18-Dec-2007, 21:57
famewolf
Guest
 
Posts: n/a
Default

Quote:
Thanks Snakedriver,

There is much power in those tools ...but its a little too much if you want to see your basic settings... also i[f-w]config don't report back name servers or route as far as I know?
[/b]


The problem you run into is people become dependent on scripts that may not always be available..the better solution is to learn how to use the native tools that will always be available on any linux version etc.....

That being said...you had enough knowledge to write the script and format it like you wanted....you are not who I'm worried about...I'm worried about the new user who grabs your script and then never learns how to do it the "normal" way.

Sort of the same reason you don't see mv aliased to move, rm aliased to delete and cp aliased to copy.
  #5 (permalink)  
Old 19-Dec-2007, 02:46
WJM
Guest
 
Posts: n/a
Default

Quote:
The problem you run into is people become dependent on scripts that may not always be available..the better solution is to learn how to use the native tools that will always be available on any linux version etc.....
[/b]
True word, as that does hold water... If I could (and when I get a grip on how to) build such things shaped in a descent tool that would be a better way to do it ...Give me a year or two... :)~

  #6 (permalink)  
Old 24-Dec-2007, 11:46
ice_60
Guest
 
Posts: n/a
Default

here's something else, i don't know how useful anyone will find it though. if you add this, below, to the end of ~/.bashrc, then run it by opening a terminal and running netinfo
Code:
netinfo ()
{
echo "--------------- Network Information ---------------"
/sbin/ifconfig | awk /'inet addr/ {print $2}'
echo ""
/sbin/ifconfig | awk /'Bcast/ {print $3}'
echo ""
/sbin/ifconfig | awk /'inet addr/ {print $4}'

# /sbin/ifconfig | awk /'HWaddr/ {print $4,$5}'
echo "---------------------------------------------------"
}
  #7 (permalink)  
Old 24-Dec-2007, 14:07
AndrewTheArt
Guest
 
Posts: n/a
Default

Maybe you could echo a statement at the beginning of the script that says something along the lines that the script is just an easier way to display certain output from route, ifconfig, and resolve.conf. Good script though - I'll definitely use it.
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2