From 1e58d00c444c8eb2a03c557f6c4aa65d1718360d Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Sat, 19 Nov 2022 12:47:20 +0100 Subject: add wait_random --- plugins/wait_random | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 plugins/wait_random (limited to 'plugins') 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 "$@" -- cgit v1.2.3