| 1 |
sysadm |
1.1 |
#!/bin/sh
|
| 2 |
|
|
|
| 3 |
|
|
# tries to login with a massive number of test accounts
|
| 4 |
|
|
|
| 5 |
|
|
# See make_testusers.sh for a way to create these accounts.
|
| 6 |
|
|
|
| 7 |
|
|
|
| 8 |
|
|
# number of accounts to connect with
|
| 9 |
|
|
numaccts=400
|
| 10 |
|
|
|
| 11 |
|
|
# "prefix" of account names
|
| 12 |
|
|
name="bob"
|
| 13 |
|
|
|
| 14 |
|
|
# account password
|
| 15 |
|
|
pass="bob"
|
| 16 |
|
|
|
| 17 |
|
|
# delay between printing messages
|
| 18 |
|
|
delay=30
|
| 19 |
|
|
|
| 20 |
|
|
# where to connect
|
| 21 |
|
|
server=localhost
|
| 22 |
|
|
|
| 23 |
|
|
# number of zero-padded columns in suffix
|
| 24 |
|
|
padding=6
|
| 25 |
|
|
|
| 26 |
|
|
# how many seconds until logout
|
| 27 |
|
|
total=600
|
| 28 |
|
|
|
| 29 |
|
|
|
| 30 |
|
|
num=0
|
| 31 |
|
|
while [ "${num}" -lt "${numaccts}" ]; do
|
| 32 |
|
|
num="`expr \"${num}\" '+' '1'`"
|
| 33 |
|
|
form="`printf \"%0${padding}d\" \"${num}\"`"
|
| 34 |
|
|
(
|
| 35 |
|
|
echo ''
|
| 36 |
|
|
echo "${name}${form}"
|
| 37 |
|
|
echo "${pass}"
|
| 38 |
|
|
total=0;
|
| 39 |
|
|
while [ "${total}" -lt "${maxtime}" ]; do
|
| 40 |
|
|
sleep "${delay}"
|
| 41 |
|
|
echo "My name is ${name}${form}"
|
| 42 |
|
|
total="`expr \"${total}\" '+' \"${delay}\"`"
|
| 43 |
|
|
done
|
| 44 |
|
|
echo "/quit"
|
| 45 |
|
|
) | telnet "${server}" 6112 &
|
| 46 |
|
|
done
|
| 47 |
|
|
|
| 48 |
|
|
exit 0
|