+make
[nethome.git] / boot
diff --git a/boot b/boot
index fd56b32..8346373 100755 (executable)
--- a/boot
+++ b/boot
@@ -5,18 +5,23 @@
 
 set -e
 abs="${BASH_SOURCE[0]}"
 
 set -e
 abs="${BASH_SOURCE[0]}"
-# bash-2.0 (RHEL3)
 if [ -z "$abs" ];then
 if [ -z "$abs" ];then
-       abs="$PWD"
-       echo >&2 "WARNING: Defaulting to: HOME=$abs"
+       # bash-2.0 (RHEL3)
+       abs="`history 1|awk '/\/boot *$/{print $NF}'`"
 fi
 fi
-if [ "$abs" = "${abs#/}" ];then
+if [ -n "$abs" -a "$abs" = "${abs#/}" ];then
        abs="$PWD/$abs"
 fi
        abs="$PWD/$abs"
 fi
-abs="`dirname "$abs"`"
-export HOME="$abs"
+if [ -z "$abs" ];then
+       HOME="$PWD"
+       echo >&2 "WARNING: Defaulting to: HOME=$HOME"
+else
+       abs="`dirname "$abs"`"
+       HOME="$abs"
+fi
+export HOME
 unset abs
 cd
 set +e
 unset abs
 cd
 set +e
-. .bashrc
+. .bash_profile
 echo OK
 echo OK