Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5391
  • Last Modified:

how to program a delay in a bash-script

i've got a little script to connect my pc to the internet. due to I'm using ip-masquerading, I have to run a script for the ipchains-rules. my problem: when I run this script which sets the rules for ipchains just after I gave the command to connect to my isp, I have no IP-adress. so i have to run this script for a second time, after about 3 seconds (I'm using ISDN). now I wanna ask, if there is a bash "delay"-command. It have not to be exactly. about 3 or 5 seconds on a pentium 100.
0
zulliger
Asked:
zulliger
  • 2
1 Solution
 
ozoCommented:
sleep 3
0
 
modulusCommented:
#!/bin/bash
echo "Now";
command sleep 10;
echo "Then";

Can do seconds, minutes, hours.  Default units are seconds.

Best wishes,
modulus
0
 
modulusCommented:
Guess ozo got there first!

m.
0
 
zulligerAuthor Commented:
thank you very much! (I hope it will work, because I havent't tried it yet...)
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now