-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathbsd.sh
More file actions
executable file
·27 lines (24 loc) · 760 Bytes
/
Copy pathbsd.sh
File metadata and controls
executable file
·27 lines (24 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
set -eE
set -o pipefail
#
# We've disabled the status reports due to the fact that stderr
# doesn't seem to be propagated properly when doing 'docker exec'.
#
if ! ssh root@localhost -oConnectTimeout=10 /bin/echo ok > /dev/null 2>&1 ; then
#echo "Checking SSH connectivity..." 1>&2
while ! ssh root@localhost -oConnectTimeout=3 /bin/echo ok > /dev/null 2>&1 ; do
# Guard against the QEMU process disapperaing:
pgrep QEMU > /dev/null 2>&1 || (
echo "FATAL: While waiting to connect, qemu shut down."
exit 242
)
#echo " Waiting..." 1>&2
sleep 1
done
fi
if [ -z "$1" ] ; then
exec ssh root@localhost -t -q /bin/sh
else
exec ssh root@localhost -t -q "$@"
fi