aboutsummaryrefslogtreecommitdiff
path: root/invoke_session_fedora
blob: 99a45d7e9bf74c9bc3960b202bae8847c8789d5f (plain)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# Usage ./invoke_session <gateway>

# Hack for now until lava-test-shell is smart enough to know it's dispatcher ip
gateway=$1
echo "Target's Gateway: $gateway"

# Copy invoke session
cp /bin/invoke_session /etc/init.d/invoke_session

# Obtain target IP and Hostname
ip_addr=$(ifconfig `ip route get $gateway | cut -d ' ' -f3` | grep 'inet ' | awk '{print $2}')
hostname=$(cat /etc/hostname)

# Set the PATH to use the LAVA api
echo "export PATH=/lava/bin/:$PATH" > ~/.bashrc

echo ""
echo ""
echo "*******************************************************************************************************"
echo -n "Please connect to: "
echo -n "ssh "
echo -n "-o UserKnownHostsFile=/dev/null "
echo -n "-o StrictHostKeyChecking=no "
echo -n "root@"
echo -n $ip_addr
echo -n " "
echo -n "("
echo -n $hostname
echo ")"
echo "*******************************************************************************************************"
echo ""
echo ""
mkdir -p /run/hacking
echo $$ > /run/hacking/hacking.pid
echo "Hacking session active..."
while [ -f /run/hacking/hacking.pid ]
do
	sleep 10
done
echo "Hacking session ended..."
echo "<LAVA_TEST_RUNNER>: exiting"