simple-bpq-telnet-application
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| simple-bpq-telnet-application [2026/01/01 22:11] – [Configuring this as a service] kc2ihx | simple-bpq-telnet-application [2026/01/01 22:42] (current) – [BPQ configuration] kc2ihx | ||
|---|---|---|---|
| Line 31: | Line 31: | ||
| < | < | ||
| - | import asyncio, telnetlib3, json | + | import asyncio, telnetlib3, json, sys |
| from optparse import OptionParser | from optparse import OptionParser | ||
| Line 40: | Line 40: | ||
| messages = json.load(open(options.filename,' | messages = json.load(open(options.filename,' | ||
| + | |||
| + | def print_log(*a): | ||
| + | print(*a, file=sys.stderr) | ||
| + | |||
| async def shell(reader, | async def shell(reader, | ||
| incall = await reader.readline() | incall = await reader.readline() | ||
| - | | + | |
| writer.write(" | writer.write(" | ||
| writer.write(" | writer.write(" | ||
| Line 51: | Line 55: | ||
| inp = await reader.read(1) | inp = await reader.read(1) | ||
| while inp and not leave and len(textblocks) > 0: | while inp and not leave and len(textblocks) > 0: | ||
| - | print(" | + | |
| writer.write(textblocks.pop(0)) | writer.write(textblocks.pop(0)) | ||
| await writer.drain() | await writer.drain() | ||
| inp = await reader.readline() | inp = await reader.readline() | ||
| - | if not rolled: | + | if not rolled: |
| - | rolled = True | + | # notify that rolling has happened |
| + | print_log("%s rickrolled" | ||
| + | rolled = True | ||
| leave = inp[0].upper() in [" | leave = inp[0].upper() in [" | ||
| writer.close() | writer.close() | ||
| Line 88: | Line 94: | ||
| In my '' | In my '' | ||
| < | < | ||
| - | CMDPORT=8005 63001 4565 10001 | + | CMDPORT=8005 63001 10001 |
| </ | </ | ||
| - | and in the application list, I added a new entry, where '' | + | and in the application list, I added a new entry, where '' |
| < | < | ||
| - | APPLICATION | + | APPLICATION |
| </ | </ | ||
simple-bpq-telnet-application.1767305496.txt.gz · Last modified: by kc2ihx