1
0
mirror of https://github.com/rancher/os.git synced 2025-08-31 22:32:14 +00:00

make run and ssh scripts more robust

Detect if KVM is available.
Enable QEMU to run w/o KVM (in the cloud or on OS X). Use --xhyve flag to run with xhyve on OS X.
This commit is contained in:
Ivan Mikushin
2015-09-03 19:06:09 +05:00
parent e94f8d8a1f
commit 74e589039b
2 changed files with 40 additions and 19 deletions

View File

@@ -7,10 +7,24 @@ chmod 0600 ./assets/rancher.key
UNAME=$(uname)
if [ "$UNAME" == "Darwin" ]; then
while [ "$#" -gt 0 ]; do
case $1 in
--xhyve)
shift 1
if [ "$UNAME" == "Darwin" ] && [ -x $(which xhyve) ]; then
XHYVE=1
fi
;;
*)
break
;;
esac
done
if [ "$XHYVE" == "1" ]; then
HOST=192.168.64.2 # consult `/var/db/dhcpd_leases` or delete it
exec ssh -F ./assets/scripts_ssh_config -i ./assets/rancher.key rancher@${HOST} "$@"
elif [ "$UNAME" == "Linux" ]; then
else
exec ssh -p 2222 -F ./assets/scripts_ssh_config -i ./assets/rancher.key rancher@localhost "$@"
fi