File: getmodemspeed

package info (click to toggle)
wmppp.app 1.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 288 kB
  • sloc: ansic: 647; makefile: 40; sh: 30
file content (18 lines) | stat: -rw-r--r-- 569 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

# this is an example getmodemspeed script
# I add '-r /var/tmp/modem.speed' to the 'connect' line in
# /etc/ppp/peers/provider and a 'REPORT CONNECT' line to
# /etc/chatscripts/provider. From my USR modem I get something like this:
#
# Opening "/var/tmp/modem.speed"...
# chat:  Sep 20 07:34:42 CONNECT nnnnn/ARQ/V32/LAPM/V42BIS
# Closing "/var/tmp/modem.speed".
#
# I'm interested in the "nnnnn" part. The following works for me, but YMMV

grep CONNECT /var/tmp/modem.speed | \
	tail -1 | \
	sed -e 's,^.*CONNECT[[:blank:]]*\([[:digit:]]*\).*$,\1,'

exit 0