From f368c60dc0c7e54706f335f16650a0e91979931a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 30 Sep 2013 02:24:56 +0200 Subject: misc fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- got | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) (limited to 'got') diff --git a/got b/got index ce6c920..429f70f 100755 --- a/got +++ b/got @@ -18,26 +18,30 @@ # along with this program. If not, see . - -tty="$1" -shift 1 - -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 - . "@etc@os-release"p -fi - -if [ -f "@etc@@command@rc" ]; then - . "@etc@@command@rc" +if [ "$1" = "---" ]; then + tty="$2" + shift 2 + + 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 + . "@etc@/os-release" + fi + + if [ -f "@etc@/@command@rc" ]; then + . "@etc@/@command@rc" + else + echo -en '\e[H\e[2J' + echo -e "\e[${ANSI_COLOR}m${NAME} (${tty})\e[00m" + echo + echo -n 'Login: ' + fi + + tty_settings="$(stty --save)" + @prefix@@libexec@/@command@.py "$@" + stty "${tty_settings}" else - echo -en '\e[H\e[2J' - echo -e "\e[${ANSI_COLOR}m${NAME} (${tty})\e[00m" - echo - echo -n 'Login: ' + tty="/dev/$1" + "$0" --- "$@" > "${tty}" 2> "${tty}" < "${tty}" fi -tty_settings="$(stty --save)" -@prefix@@libexec@/@command@.py "$@" <> "/dev/${tty}" 2>&1 -stty "${tty_settings}" - -- cgit v1.2.3-70-g09d2