diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2022-11-19 12:47:20 +0100 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2022-11-19 12:47:20 +0100 |
commit | 1e58d00c444c8eb2a03c557f6c4aa65d1718360d (patch) | |
tree | 6ecab9ccddaeb5d1a324b4bc86b34d015d3e0d27 | |
parent | d6dc8b2af0b8110e1fc5c01375a8c1a3466cd3f5 (diff) | |
download | monitoring_custom-1e58d00c444c8eb2a03c557f6c4aa65d1718360d.tar.gz |
add wait_random
-rwxr-xr-x | plugins/wait_random | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/wait_random b/plugins/wait_random new file mode 100755 index 0000000..2980ac6 --- /dev/null +++ b/plugins/wait_random @@ -0,0 +1,13 @@ +#!/bin/bash + +# Wait a random amount of seconds between 0 and $1. +# Used for SSH connections to not DOS servers. +# +# USAGE: wait_random MAX_TIME COMMAND ARGS ... + +MAXTIME="$1" +shift + +sleep $((RANDOM % MAXTIME)) + +exec "$@" |