#!/usr/bin/env bash RANDOM=$(head -c 16 /dev/random | shasum) generate_identity() { ANIMALS=("horse cow sheep chicken goat donkey mouse pig duck") USERNAME=$(whoami) if [[ "${USERNAME}" == "mark" ]]; then PLACES="nova-scotia prince-edward-island newfoundland-and-labrador new-brunswick quebec ontario manitoba saskatchewan alberta british-columbia yukon northwest-territories nunavut" elif [[ "${USERNAME}" == "johannes" ]]; then ANIMALS=("pferd kuh schaf huhn ziege esel maus schwein ente") PLACES="baden-württemberg bayern berlin brandenburg bremen hamburg hessen niedersachsen mecklenburg-vorpommern nordrhein-westfalen rheinland-pfalz saarland sachsen sachsen-anhalt schleswig-holstein thüringen" else PLACES="alabama alaska american-samoa arizona arkansas california colorado connecticut delaware district-of-columbia florida georgia guam hawaii idaho illinois indiana iowa kansas kentucky louisiana maine maryland massachusetts michigan minnesota mississippi missouri montana nebraska nevada new-hampshire new-jersey new-mexico new-york north-carolina north-dakota northern-mariana-islands ohio oklahoma oregon pennsylvania puerto-rico rhode-island south-carolina south-dakota tennessee texas utah vermont virgin-islands virginia washington west-virginia wisconsin wyoming" fi ANIMALS_ARR=( $ANIMALS ) PLACES_ARR=( $PLACES ) STATE=${PLACES_ARR[$RANDOM % ${#PLACES_ARR[@]} ]} ANIMAL=${ANIMALS_ARR[$RANDOM % ${#ANIMALS_ARR[@]} ]} ## note: $$ is our PID, so we can guarantee no collisions happen on a single host echo "${STATE}-${ANIMAL}-$$" } exec cargo run -- --identity "$(generate_identity)"