mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-20 16:15:59 +01:00
In POSIX sh, RANDOM is undefined: use always the other method
This commit is contained in:
parent
f4e2d278ba
commit
84d23e60d1
@ -15,19 +15,12 @@
|
|||||||
|
|
||||||
INPUT=$1
|
INPUT=$1
|
||||||
|
|
||||||
if test -n ${BASH_VERSION:-''} ; then
|
for n in $(od -A n -t u2 -N 48 /dev/urandom); do RL="$RL$n "; done
|
||||||
get_random ()
|
get_random ()
|
||||||
{
|
{
|
||||||
R=$RANDOM
|
R=${RL%% *}
|
||||||
}
|
RL=${RL#* }
|
||||||
else
|
}
|
||||||
for n in $(od -A n -t u2 -N 48 /dev/urandom); do RL="$RL$n "; done
|
|
||||||
get_random ()
|
|
||||||
{
|
|
||||||
R=${RL%% *}
|
|
||||||
RL=${RL#* }
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
|
|
||||||
get_random
|
get_random
|
||||||
WAVE1_AMPLITUDE=$((2 + R % 5))
|
WAVE1_AMPLITUDE=$((2 + R % 5))
|
||||||
|
Loading…
Reference in New Issue
Block a user