s4:auth/ntlm: allow auth_operations to specify check_password_send/recv()
[sfrench/samba-autobuild/.git] / script / random-sleep.sh
1 #!/bin/sh
2 #
3
4 if [ $# -lt 2 ]; then
5         echo "$0: <low> <high>"
6         exit 1;
7 fi
8
9 l=$1
10 h=$2
11
12 s=$(expr $h - $l)
13
14 r=$(head --bytes=2 /dev/urandom | od -l | head -n 1 | sed -e 's/^[^ ]*  *//')
15
16 v=$(expr $r % $s)
17 d=$(expr $l + $v)
18
19 if test "x${AUTOBUILD_RANDOM_SLEEP_OVERRIDE}" != "x" ; then
20         d="${AUTOBUILD_RANDOM_SLEEP_OVERRIDE}"
21 fi
22
23 echo "$0: sleep $d ... start"
24 sleep $d
25 echo "$0: sleep $d ... end"