- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Print the flag UP the exit command ifconfig
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2007 01:48 AM
01-09-2007 01:48 AM
I need the check if the interface card the my server is UP or DOWN. I have a script, but i´m not have success. Im using the following command line for get the flag "UP".
ifconfig lan0 | head -1 | awk 'BEGIN { FS = "<" } ; { print $2 }'
Solved! Go to Solution.
- Tags:
- ifconfig
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2007 01:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2007 01:56 AM
01-09-2007 01:56 AM
Re: Print the flag UP the exit command ifconfig
/net/interfaces/lan/status/lan0
Cheers
Wout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2007 02:22 AM
01-09-2007 02:22 AM
Re: Print the flag UP the exit command ifconfig
have you tried:
ifconfig lan0 | head -1 | awk -F'[<,]' '{print $2}'
Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.
So far you have not awarded any points !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2007 09:23 PM
01-10-2007 09:23 PM
Re: Print the flag UP the exit command ifconfig
*blush*
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2007 10:17 PM
01-10-2007 10:17 PM
Re: Print the flag UP the exit command ifconfig
Try this
$ /usr/sbin/ifconfig lan0|grep lan0|cut -d "<" -f 2|cut -f 1 -d ","
-Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2007 11:46 PM
01-10-2007 11:46 PM
Re: Print the flag UP the exit command ifconfig
and several to query the nic's state.
Since you began with awk you could do the
parsing like this e.g.
[[ $(ifconfig lan0|awk -F\< '$2~/UP/{split($2,a,",");print a[1]}') = UP ]] && echo up
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2007 03:52 AM
02-26-2007 03:52 AM
Re: Print the flag UP the exit command ifconfig
my script is work fine.
Tks.
Claudemir