| 1 | ;;; ---kermit--- |
| 2 | ;;; |
| 3 | ;;; Configuration and definitions for Kermit. |
| 4 | |
| 5 | assign _profile @profile@/ |
| 6 | assign _dot \v(home).kermit/ |
| 7 | |
| 8 | ;; General stuff. |
| 9 | set escape-character ^] |
| 10 | set flow-control /direct-serial rts/cts |
| 11 | set flow-control /modem rts/cts |
| 12 | set locus local |
| 13 | set options directory /brief |
| 14 | set terminal trigger KERMIT READY TO SERVE... |
| 15 | set transfer pipes on |
| 16 | |
| 17 | ;; Dialling parameters. |
| 18 | set dial country-code 44 |
| 19 | set dial area-code 1223 |
| 20 | set dial display on |
| 21 | set dial toll-free-area-code 800 |
| 22 | set dial ld-prefix 0 |
| 23 | set dial intl-prefix 00 |
| 24 | |
| 25 | ;; Directories. |
| 26 | def _dir_exist { |
| 27 | undef _dir |
| 28 | for \%i 1 \fdim(&v) 1 { |
| 29 | if exist \&v[\%i] { |
| 30 | if def _dir assign _dir \m(_dir) \&v[\%i] |
| 31 | else assign _dir \&v[\%i] |
| 32 | } |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | local \&v |
| 37 | local \%n |
| 38 | array dcl v = - |
| 39 | \m(_profile)kermit/net.shared - |
| 40 | \m(_dot)net.local |
| 41 | local _dir |
| 42 | _dir_exist |
| 43 | set network directory \m(_dir) |
| 44 | |
| 45 | array dcl v = - |
| 46 | \m(_profile)kermit/dial.shared - |
| 47 | \m(_dot)dial.local |
| 48 | local _dir |
| 49 | _dir_exist |
| 50 | set dial directory \m(_dir) |
| 51 | |
| 52 | ;; If my terminal is UTF8 then try to use that consistently. This may not |
| 53 | ;; work, but in my world as it is it's quite likely to. |
| 54 | local _lc_ctype |
| 55 | if not def _lc_ctype if def \$(LC_ALL) assign _lc_ctype \$(LC_ALL) |
| 56 | if not def _lc_ctype if def \$(LC_CTYPE) assign _lc_ctype \$(LC_CTYPE) |
| 57 | if not def _lc_ctype if def \$(LANG) assign _lc_ctype \$(LANG) |
| 58 | if match \m(_lc_ctype) *.utf8 { |
| 59 | set file character-set utf8 |
| 60 | set terminal character-set utf8 |
| 61 | } |
| 62 | |
| 63 | ;; Set the HTTP proxy from the environment. |
| 64 | if def \$(http_proxy) { |
| 65 | assign \%n \fsplit(\$(http_proxy),&v,/) |
| 66 | set tcp http-proxy \&v[2] |
| 67 | } |
| 68 | |
| 69 | ;; Guest virtual consoles are frequently presented as Unix-domain sockets. |
| 70 | def UNIX { |
| 71 | if <= \v(argc) 1 - |
| 72 | end 1 Usage: UNIX socket |
| 73 | pipe nc -U \%1 |
| 74 | } |
| 75 | |
| 76 | ;; Connect to a kermit SSH subsystem. |
| 77 | def KERMSSH { |
| 78 | if <= \v(argc) 1 - |
| 79 | end 1 Usage: KERMSSH [options] [user@]host |
| 80 | set clear-channel on |
| 81 | pty ssh -enone -st \%* kermit |
| 82 | } |
| 83 | |
| 84 | ;; Console over null-modem cable. |
| 85 | def CONSOLE { |
| 86 | if > \v(argc) 1 set speed \%1 |
| 87 | if > \v(argc) 2 set serial \%2 |
| 88 | else set serial 8n1 |
| 89 | set modem type none |
| 90 | set carrier-watch off |
| 91 | set clear-channel on |
| 92 | connect |
| 93 | } |
| 94 | |
| 95 | ;; Synchronize remote terminal size with local window. |
| 96 | def syncwinsz output stty rows \v(rows) columns \v(cols)\13 |
| 97 | |
| 98 | ;; Local configuration. |
| 99 | if exist \m(_dot)config take \m(_dot)config |