LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-13-2012, 01:45 AM   #1
sluge
Member
 
Registered: Dec 2006
Location: Russia,52
Posts: 128

Rep: Reputation: 6
Question Please explain me command


Hello!

What this command is responsible for?
This run on remote shell:

sleep 90 | ifdown eth0 && ifup eth0

It looks like it delays disconection?
 
Old 11-13-2012, 01:49 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by sluge View Post
What this command is responsible for?
This run on remote shell:

sleep 90 | ifdown eth0 && ifup eth0

It looks like it delays disconection?
first sleep for 90 seconds, then bring down eth0 if this succeeds (&&) bring up eth0

EDIT: see ntubski's reply (post #3)

sleep for 90 seconds and bring down eth0 if this succeeds (&&) and after a 90 sec delay, bring up eth0

Last edited by druuna; 11-13-2012 at 07:37 AM. Reason: answered too fast, ntubski put the finger on that....
 
Old 11-13-2012, 07:12 AM   #3
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Actually, the sleep and the ifup are in a pipeline so they run in parallel. So it really only delays the reconnect. I think it would be better to write it like this
Code:
ifdown eth0 && sleep 90 && ifup eth0
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Parse/ explain sed line command to understand what it does/ the logic varu0612 Programming 2 09-16-2012 09:47 AM
please explain this command infohntr General 10 07-04-2009 12:13 PM
Explain sort command viveksnv Programming 3 02-27-2008 09:08 PM
explain this command please varunbihani Linux - General 9 07-09-2005 02:48 AM
can someone explain what the mail command does? ludwig W Linux - Software 10 05-17-2003 11:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration