1
0
mirror of https://github.com/rancher/os.git synced 2025-05-02 13:23:23 +00:00
os/scripts/ssh

31 lines
647 B
Plaintext
Raw Normal View History

#!/bin/bash
set -e
cd $(dirname $0)/..
2015-05-10 11:59:38 +00:00
chmod 0600 ./assets/rancher.key
2015-07-21 11:42:59 +00:00
UNAME=$(uname)
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
2015-07-21 11:42:59 +00:00
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} "$@"
else
2015-07-21 11:42:59 +00:00
exec ssh -p 2222 -F ./assets/scripts_ssh_config -i ./assets/rancher.key rancher@localhost "$@"
fi