bash if condition, then continue
Posted on 2014-08-21
Need a quick bash solution to the following problem...
A bash script is starting before the system has it's dhcp address and therefore it is failing.
It is further failing because it is taking a while for the system to get it's updated time from it's default of 1970.
I need to run a one time test at the very start of my script which will check to see what year it is.
If the year is not 20xx then it implies that full network connectivity has not been achieved yet so repeat the test.
Once the system year is 20xx, it means that the network has started and that the system has internet access so time to end this function and continue the script.
-script starts up
-checks to see what year it is on the system
-if the year is 1070, then loop and try trying again one second later
-Once the year is 20xx, this function dies for good and the script continues on to it's main functions