misc new stuff
[automated-distro-installer] / myfai-chboot
index 7991542d75e1ca717da1cde0edaf0004a51ebdd4..308b1c70a04e317cb47e1aeacdefbc831d2c4426 100755 (executable)
@@ -36,9 +36,11 @@ case $1 in
   -h|--help) usage ;;
 esac
 
+
+faiserver_addr=$(host faiserver | sed -rn 's/^\S+ has address //p;T;q' ||:)
 host=$(./chost faiserver)
-if [[ $host == $(./chost $HOSTNAME) ]]; then
+if ip a | grep "^ *inet.\? $faiserver_addr" &>/dev/null; then
   ./myfai-chboot-local "$@"
 else
-  ssh root@$host bash -s "$@" <myfai-chboot-local
+  ssh root@$host bash -s -- "$@" <myfai-chboot-local
 fi