| 1 | #!/bin/sh |
| 2 | |
| 3 | # creates massive numbers of dummy "test" accounts |
| 4 | |
| 5 | |
| 6 | # number of accounts to connect with |
| 7 | numaccts=400 |
| 8 | |
| 9 | # "prefix" of account names |
| 10 | name="bob" |
| 11 | |
| 12 | # account password |
| 13 | pass="bob" |
| 14 | |
| 15 | # number of zero-padded columns in suffix |
| 16 | padding=6 |
| 17 | |
| 18 | # "users" directory |
| 19 | users=/usr/local/bnetd/var/users |
| 20 | |
| 21 | # bnpass command |
| 22 | bnpass=/usr/local/bnetd/bin/bnpass |
| 23 | |
| 24 | |
| 25 | hash="`echo \"${pass}\" | \"${bnpass}\" | sed -e 's/^.*"\([0-9a-f]*\)"/\1/'`" |
| 26 | |
| 27 | num=0 |
| 28 | while [ "${num}" -lt 400 ]; do |
| 29 | num="`expr \"${num}\" '+' '1'`" |
| 30 | form="`printf \"%06d\" \"${num}\"`" |
| 31 | ( |
| 32 | echo '"BNET\\acct\\username"="'"${name}${form}"'"' |
| 33 | echo '"BNET\\acct\\passhash1"="'"${hash}"'"' |
| 34 | echo '"BNET\\acct\\userid"="'"${num}"'"' |
| 35 | ) > "${users}/${form}" |
| 36 | done |
| 37 | |
| 38 | exit 0 |