Debian Codegraph @

scripts/make_testusers.sh

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/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/usersscip-shell filesystem . . `/usr/local/bnetd/var/users`.
20
21 # bnpass command
22 bnpass=/usr/local/bnetd/bin/bnpassscip-shell filesystem . . `/usr/local/bnetd/bin/bnpass`.
23
24
25 hash="`echoscip-shell system . . echo. \"${pass}\" | \"${bnpass}\" | sedscip-shell system . . sed. -e 's/^.*"\([0-9a-f]*\)"/\1/'`"
26
27 num=0
28 while [scip-shell system . . `[`. "${num}" -lt 400 ]; do
29 num="`exprscip-shell system . . expr. \"${num}\" '+' '1'`"
30 form="`printfscip-shell system . . printf. \"%06d\" \"${num}\"`"
31 (
32 echoscip-shell system . . echo. '"BNET\\acct\\username"="'"${name}${form}"'"'
33 echoscip-shell system . . echo. '"BNET\\acct\\passhash1"="'"${hash}"'"'
34 echoscip-shell system . . echo. '"BNET\\acct\\userid"="'"${num}"'"'
35 ) > "${users}/${form}"
36 done
37
38 exit 0