Created
June 19, 2023 14:03
-
-
Save earnhardt3rd/6cb28255cfe504a178b6715878f1a094 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'getopts.pl'; | |
| Getopts('m:d:tS:D:'); | |
| my $MODE = uc($opt_m) || ""; | |
| my $DEBUG = $opt_d || 0; | |
| my $SLEEP = $opt_S || 5; | |
| my $DOTS = $opt_D || ""; | |
| if (defined $opt_t) { my %TEST = &_SLEEPER($SLEEP,$DOTS);} | |
| 1; | |
| sub _SLEEPER { | |
| # This allow script to catch SIGS | |
| my $sleepSecs = shift || 5; | |
| my $sleepDots = shift || ""; | |
| my $preFlush = $|; | |
| if ($sleepDots ne "") {$|=1;} | |
| for (my $si=0;$si<=$sleepSecs ;$si++) { | |
| if ($sleepDots ne "") {print ".";} | |
| sleep 1; | |
| } | |
| if ($sleepDots ne "") {$|=$preFlush;} | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment