X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=blobdiff_plain;f=boot;h=05c567586643cd3470d054c964d68d434d818975;hp=8b6b8f30631d6ba517121a8a96442c6cd50253c4;hb=242fbae6821509bd874272c763758717a5cc37a6;hpb=5b42066804db3c8574025ab7647a2d45a256fce9 diff --git a/boot b/boot index 8b6b8f3..05c5675 100755 --- a/boot +++ b/boot @@ -5,14 +5,17 @@ set -e abs="${BASH_SOURCE[0]}" -# bash-2.0 (RHEL3) +if [ -z "$abs" ];then + # bash-2.0 (RHEL3) + abs="`history 1|awk '/\/boot *$/{print $NF}'`" +fi +if [ -n "$abs" -a "$abs" = "${abs#/}" ];then + abs="$PWD/$abs" +fi if [ -z "$abs" ];then HOME="$PWD" echo >&2 "WARNING: Defaulting to: HOME=$HOME" else - if [ "$abs" = "${abs#/}" ];then - abs="$PWD/$abs" - fi abs="`dirname "$abs"`" HOME="$abs" fi