Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,21 @@ func_lib_restore_pulseaudio()
unset PULSECMD_LST
declare -ag PULSECMD_LST
}

func_lib_get_random()
{
# RANDOM: Each time this parameter is referenced, a random integer between 0 and 32767 is generated
local random_max random_min random_scope
if [ $# -ge 2 ];then
random_max=$2
random_min=$1
random_scope=$(expr $random_max - $random_min)
expr $RANDOM % $random_scope + $random_min
elif [ $# -eq 1 ];then
random_max=$1
expr $RANDOM % $random_max
else
echo $RANDOM
fi
}