File: login_testusers.sh

package info (click to toggle)
bnetd 0.4.25-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,516 kB
  • ctags: 7,224
  • sloc: ansic: 67,547; sh: 3,142; makefile: 796; python: 304; perl: 211; awk: 73
file content (48 lines) | stat: -rwxr-xr-x 916 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh

# tries to login with a massive number of test accounts

# See make_testusers.sh for a way to create these accounts.


# number of accounts to connect with
numaccts=400

# "prefix" of account names
name="bob"

# account password
pass="bob"

# delay between printing messages
delay=30

# where to connect
server=localhost

# number of zero-padded columns in suffix
padding=6

# how many seconds until logout
total=600


num=0
while [ "${num}" -lt "${numaccts}" ]; do
    num="`expr \"${num}\" '+' '1'`"
    form="`printf \"%0${padding}d\" \"${num}\"`"
    (
        echo ''
        echo "${name}${form}"
        echo "${pass}"
        total=0;
        while [ "${total}" -lt "${maxtime}" ]; do
            sleep "${delay}"
            echo "My name is ${name}${form}"
            total="`expr \"${total}\" '+' \"${delay}\"`"
        done
        echo "/quit"
    ) | telnet "${server}" 6112 &
done

exit 0