diff options
| author | Mattias Andrée <maandree@operamail.com> | 2013-09-30 05:48:09 +0200 |
|---|---|---|
| committer | Mattias Andrée <maandree@operamail.com> | 2013-09-30 05:48:09 +0200 |
| commit | a1c3f33f393b671b846a40af6538a1887b8ed13b (patch) | |
| tree | beb8589631bf6f54bbc120a51744cb644b02f26a | |
| parent | m + typo (diff) | |
| download | gates-of-tartaros-a1c3f33f393b671b846a40af6538a1887b8ed13b.tar.gz gates-of-tartaros-a1c3f33f393b671b846a40af6538a1887b8ed13b.tar.bz2 gates-of-tartaros-a1c3f33f393b671b846a40af6538a1887b8ed13b.tar.xz | |
separate username reading and logging in
Signed-off-by: Mattias Andrée <maandree@operamail.com>
| -rwxr-xr-x | got | 26 | ||||
| -rw-r--r-- | info/gates-of-tartaros.texinfo | 18 |
2 files changed, 26 insertions, 18 deletions
@@ -24,12 +24,25 @@ if [ "$1" = "-" ]; then export "$@" - login_function=_login display_function=_display + read_function=_read + login_function=_login - function _login + function _display + { + echo -en '\e[H\e[2J' + echo -e "\e[${ANSI_COLOR}m${NAME} (${tty})\e[00m" + echo + echo -n 'Login: ' + } + + function _read { read user + } + + function _login + { if [ ! "${user/@/}" = "${user}" ]; then export GOT_COMMAND="@ssh@ ${user}" login -p -f @sshlogin@ @@ -42,14 +55,6 @@ if [ "$1" = "-" ]; then fi } - function _display - { - echo -en '\e[H\e[2J' - echo -e "\e[${ANSI_COLOR}m${NAME} (${tty})\e[00m" - echo - echo -n 'Login: ' - } - NAME="$(uname -o)" ANSI_COLOR='01;34' # must be exactly ANSI_COLOR as it is defined in /etc/os-release if [ -f "@etc@/os-release" ]; then @@ -60,6 +65,7 @@ if [ "$1" = "-" ]; then fi $display_function + $read_function $login_function else # cannot get any other solution to work with `login` diff --git a/info/gates-of-tartaros.texinfo b/info/gates-of-tartaros.texinfo index f7773e1..f6b3e9b 100644 --- a/info/gates-of-tartaros.texinfo +++ b/info/gates-of-tartaros.texinfo @@ -151,16 +151,18 @@ the file @file{@value{ETC}/@value{GOT}rc} if it exists. @file{@value{ETC}/@value{GOT}rc} can change the behaviour of Gates of Tartaros or source other files that does so. -Gates of Tartaros as two functions is calls directly after +Gates of Tartaros as three functions is calls directly after each other: @code{_display} for printing everying you see, -and then @code{_login} to ask for username and start a +@code{_read} to accept username input and stores it in the +variable @code{user}, and then @code{_login} to start a login. Password checking is handled by external programs -@command{@value{SSH}} and @command{login} that are used doing -the actual user login. You either redefine these functions, -or change the variables @code{display_function} or -@code{login_function} to contain the name of the functions -you want to be called instead. The latter option can be -used to extend rather then replace the predefined functions. +@command{@value{SSH}} and @command{login} that are used +doing the actual user login. You either redefine these +functions, or change the variables @code{display_function}, +@code{read_function} or @code{login_function} to contain the +name of the functions you want to be called instead. The +latter option can be used to extend rather then replace the +predefined functions. The file @file{@value{ETC}/os-release} will have been sources before the extensions and @code{NAME} and @code{ANSI_COLOR} |
