mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
06be5962ab
set AUTOBUILD_RANDOM_SLEEP_OVERRIDE=<x> to the number x of seconds that you want to sleep. This is added to make it possible to run one autobuild target without having to wait for several minutes. Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
26 lines
390 B
Bash
Executable File
26 lines
390 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
|
|
if [ $# -lt 2 ]; then
|
|
echo "$0: <low> <high>"
|
|
exit 1;
|
|
fi
|
|
|
|
l=$1
|
|
h=$2
|
|
|
|
s=$(expr $h - $l)
|
|
|
|
r=$(head --bytes=2 /dev/urandom | od -l | head -n 1 | sed -e 's/^[^ ]* *//')
|
|
|
|
v=$(expr $r % $s)
|
|
d=$(expr $l + $v)
|
|
|
|
if test "x${AUTOBUILD_RANDOM_SLEEP_OVERRIDE}" != "x" ; then
|
|
d="${AUTOBUILD_RANDOM_SLEEP_OVERRIDE}"
|
|
fi
|
|
|
|
echo "$0: sleep $d ... start"
|
|
sleep $d
|
|
echo "$0: sleep $d ... end"
|