From 73bb9001656336e456a7e71c5db8098f805f9474 Mon Sep 17 00:00:00 2001 Message-Id: <73bb9001656336e456a7e71c5db8098f805f9474.1717418836.git.mdw@distorted.org.uk> From: Mark Wooding Date: Fri, 17 Feb 2012 01:23:43 +0000 Subject: [PATCH] dot/mykermrc, bin/guest-console: Kermit configuration. Organization: Straylight/Edgeware From: Mark Wooding This seems the best solution to the guest-serial-comms problem. --- bin/guest-console | 17 +++++++++++++++++ dot/kermrc | 27 +++++++++++++++++++++++++++ setup | 2 ++ 3 files changed, 46 insertions(+) create mode 100755 bin/guest-console create mode 100644 dot/kermrc diff --git a/bin/guest-console b/bin/guest-console new file mode 100755 index 0000000..0ff8848 --- /dev/null +++ b/bin/guest-console @@ -0,0 +1,17 @@ +#! /usr/bin/kermit + + +take /etc/kermit/kermrc + +set exit on-disconnect on + +def GUESTDIR /mnt/guests +if def \$(GUESTDIR) assign GUESTDIR \$(GUESTDIR) + +local guest +if != \v(argc) 2 - + exit 1 Usage: GUEST [user/]guest +assign guest \%1 +if not match {\m(guest)} */* - + assign guest \v(userid)/\m(guest) + +pipe nc -U \m(GUESTDIR)/\m(guest)/console diff --git a/dot/kermrc b/dot/kermrc new file mode 100644 index 0000000..9620593 --- /dev/null +++ b/dot/kermrc @@ -0,0 +1,27 @@ +;;; ---kermit--- +;;; +;;; Configuration and definitions for Kermit. + +set escape-character ^] +set terminal trigger KERMIT READY TO SERVE... + +;; If my terminal is UTF8 then try to use that consistently. This may not +;; work, but in my world as it is it's quite likely to. +local _lc_ctype +if not def _lc_ctype if def \$(LC_ALL) assign _lc_ctype \$(LC_ALL) +if not def _lc_ctype if def \$(LC_CTYPE) assign _lc_ctype \$(LC_CTYPE) +if not def _lc_ctype if def \$(LANG) assign _lc_ctype \$(LANG) +if match \m(_lc_ctype) *.utf8 { + set file character-set utf8 + set terminal character-set utf8 +} + +;; Guest virtual consoles are frequently presented as Unix-domain sockets. +def UNIX { + if < \v(argc) 1 - + end 1 Usage: UNIX socket + pipe nc -U \%1 +} + +;; Synchronize remote terminal size with local window. +def syncwinsz output stty rows \v(rows) columns \v(cols)\13 diff --git a/setup b/setup index c90e390..09e3005 100755 --- a/setup +++ b/setup @@ -141,6 +141,7 @@ dotfiles=" guile rcrc toprc + kermrc mc-ini:.mc/ini mc-panels.ini:.mc/panels.ini aspell.conf tclshrc:.tclshrc tclshrc:.wishrc @@ -241,6 +242,7 @@ scripts=" lesspipe.sh start-ssh-agent svnwrap + guest-console hyperspec" [ "$xstuff" ] && scripts="$scripts xinitcmd -- [mdw]