#!/bin/sh -e

fn_genpass() {
    printf "Password: %s\n" $(busybox tr -dc '[A-Z][a-z][0-9]' </dev/urandom | dd bs=1 count=${1:-80} 2>/dev/null; echo)
}
fn_genuser() {
    printf "Username: %s\n" $(busybox tr -dc '[A-Z][a-z][0-9]' </dev/urandom | dd bs=1 count=10 2>/dev/null; echo)
}

case $1 in
    -p)
	fn_genpass $2
	;;
    -u)
	fn_genuser
	;;
    *)
	cat <<EOF
Usage:
kanako_gen -p <count>
kanako_gen -u
EOF
	;;
esac
