Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
echo "Start random stress"
while true; do
RANYES=$[ ( $RANDOM % 4 ) + 1 ]
RANSTR=$[ ( $RANDOM % 300 ) + 1 ]s
RANSLEEP=$[ ( $RANDOM % 3000 ) + 1 ]s
echo "Start $RANYES proccess for $RANSTR seconds"
c=1
while [[ $c -le $RANYES ]]; do
timeout $RANSTR yes > /dev/null &
let c=c+1
done
wait
echo "Sleep for $RANSLEEP"
sleep $RANSLEEP
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.