wok-stable rev 4620

ajaxterm: add knock support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Dec 17 19:13:33 2009 +0100 (2009-12-17)
parents 0863ca91f10a
children 4d4282b75d01
files ajaxterm/stuff/usr/share/ajaxterm/login
line diff
     1.1 --- a/ajaxterm/stuff/usr/share/ajaxterm/login	Thu Dec 17 18:48:49 2009 +0100
     1.2 +++ b/ajaxterm/stuff/usr/share/ajaxterm/login	Thu Dec 17 19:13:33 2009 +0100
     1.3 @@ -8,8 +8,16 @@
     1.4  [ -n "$server" ] || exec /bin/login
     1.5  sshport=""
     1.6  case "$server" in
     1.7 -*:*)	sshport="-p ${server#*:}"; server=${server%:*};;
     1.8 +*:*)	sshport="-p ${server#*:}"
     1.9 +	server=${server%:*};;
    1.10  esac
    1.11 +if [ -x /usr/bin/knock ]; then
    1.12 +	case "$server" in
    1.13 +	!*)	server=${server#*!}"
    1.14 +		echo -n "Knock sequence (port[:proto]...): "
    1.15 +		read -t 30 sequence && knock ${server#*@} $sequence
    1.16 +	esac
    1.17 +fi
    1.18  case "$server" in
    1.19  *@*)	;;
    1.20  *)	echo -n "$server login: "