cleanup: let conversion to including devid and change in devid happen at different rates

This commit is contained in:
Eric House 2013-09-17 19:11:47 -07:00
parent 5d49b9b5d6
commit 9169659c80

View file

@ -433,15 +433,18 @@ update_ldevid() {
KEY=$1
HELP="$(${APPS[$KEY]} --help 2>&1 || /bin/true)"
if echo $HELP | grep -q '\-\-ldevid'; then
if [ $((RANDOM % 100)) -lt 33 ]; then
CMD="${ARGS_DEVID[$KEY]}"
if [ -z "$CMD" ]; then # upgrade or first run
RNUM=$((RANDOM % 100))
CMD="${ARGS_DEVID[$KEY]}"
if [ -z "$CMD" ]; then
if [ $RNUM -lt 30 ]; then # upgrade or first run
CMD="--ldevid LINUX_TEST_$(printf %.5d ${KEY})_"
else
CMD="${CMD}x" # give it a new local ID
fi
ARGS_DEVID[$KEY]="$CMD"
else
if [ $RNUM -lt 10 ]; then
CMD="${CMD}x" # give it a new local ID
fi
fi
ARGS_DEVID[$KEY]="$CMD"
fi
}