Implement serial console (mclu console ..)
[mclu.git] / run.in
diff --git a/run.in b/run.in
index 7954b50..230258a 100644 (file)
--- a/run.in
+++ b/run.in
@@ -1,6 +1,6 @@
 #!/bin/bash -
-# mclu (mini cluster)
-# Copyright (C) 2014 Red Hat Inc.
+# mclu: Mini Cloud
+# Copyright (C) 2014-2015 Red Hat Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-b=@abs_top_builddir@
+# Source and build directories (absolute paths so this works from any
+# directory).
+s="$(cd @abs_srcdir@ && pwd)"
+b="$(cd @abs_builddir@ && pwd)"
 
-echo $b/mclu.py -f $b/mclu.conf "$@"
-exec $b/mclu.py -f $b/mclu.conf "$@"
+PATH="$b:$PATH"
+export PATH
+
+if [ -z "$MCLU_PATH" ]; then
+    MCLU_PATH="$s/templates"
+    export MCLU_PATH
+fi
+
+if [ -z "$MCLU_CONFIG" ]; then
+    MCLU_CONFIG="$s/mclu.conf"
+    export MCLU_CONFIG
+fi
+
+if libtool --help >/dev/null 2>&1; then
+    libtool="libtool --mode=execute"
+fi
+
+exec $libtool "$@"