LinuxQuestions.org
Review your favorite Linux distribution.
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, 02:45 AM   #1
sluge
Member
 
Registered: Dec 2006
Location: Russia,52
Posts: 116

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, 02:49 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390
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 08:37 AM. Reason: answered too fast, ntubski put the finger on that....
 
Old 11-13-2012, 08:12 AM   #3
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,256

Rep: Reputation: 1421Reputation: 1421Reputation: 1421Reputation: 1421Reputation: 1421Reputation: 1421Reputation: 1421Reputation: 1421Reputation: 1421Reputation: 1421
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 10:47 AM
please explain this command infohntr General 10 07-04-2009 01:13 PM
Explain sort command viveksnv Programming 3 02-27-2008 10:08 PM
explain this command please varunbihani Linux - General 9 07-09-2005 03:48 AM
can someone explain what the mail command does? ludwig W Linux - Software 10 05-18-2003 12:46 AM

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

All times are GMT -5. The time now is 08:37 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration