From 21f848ee689584840a3002a7888337df6a1d00f0 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 30 Sep 2013 03:58:57 +0200 Subject: more installation flexibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 4 ++++ got | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ac3a09e..e4f7994 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,13 @@ PREFIX = SYSCONF = /etc +DEV = /dev BIN = /bin SBIN = /sbin LICENSES = /usr/share/licenses COMMAND = got PKGNAME = gates-of-tartaros SSHUSER = sshlogin +SSH = ssh BASH_SHEBANG = /usr/bin/env bash @@ -16,9 +18,11 @@ got.install: got cp "$<" "$@" sed -i 's:#!/usr/bin/env bash:#!$(BASH_SHEBANG):g' "$@" sed -i 's:@prefix@:$(PREFIX):g' "$@" + sed -i 's:@dev@:$(DEV):g' "$@" sed -i 's:@etc@:$(SYSCONF):g' "$@" sed -i 's:@command@:$(COMMAND):g' "$@" sed -i 's:@sshlogin@:$(SSHUSER):g' "$@" + sed -i 's:@ssh@:$(SSH):g' "$@" got-cmd.install: got-cmd cp "$<" "$@" diff --git a/got b/got index ba8a41a..58972c9 100755 --- a/got +++ b/got @@ -31,7 +31,7 @@ if [ "$1" = "-" ]; then { read user if [ ! "${user/@/}" = "${user}" ]; then - export GOT_COMMAND="ssh ${user}" + export GOT_COMMAND="@ssh@ ${user}" login -p -f @sshlogin@ elif [ "${user::1}" = "-" ]; then stty -icanon -echo -isig -ix{on,off,any} @@ -65,7 +65,7 @@ else # cannot get any other solution to work with `login` # then to spawn a new process with pipes preset - tty="/dev/$1" + tty="@dev@/$1" tty_settings="$(stty --save)" "$0" - "$@" > "${tty}" 2> "${tty}" < "${tty}" stty "${tty_settings}" -- cgit v1.2.3-70-g09d2