aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2016-06-03 16:47:52 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2016-06-03 16:47:52 +0800
commit17a79a7f618c70395384b6384d7460c48f8a1e8f (patch)
treeda28080ef26a9ab6056ce3beb8fd7dd2418f6b05
parentb14deada9c3b5a4eae15c8e2aca41efdee83a05a (diff)
parentdefeaf0263acf12e5bc1aad13e0d31d8ffbd3946 (diff)
Merge branch 'master' of git://git.linaro.org/lava-team/hacking-session
-rwxr-xr-xinvoke_session_debian15
1 files changed, 4 insertions, 11 deletions
diff --git a/invoke_session_debian b/invoke_session_debian
index d095dfc..963adf6 100755
--- a/invoke_session_debian
+++ b/invoke_session_debian
@@ -16,7 +16,7 @@ then
fi
# Obtain target IP and Hostname
-ip_addr=$(ifconfig `ip route get $gateway | cut -d ' ' -f3` | grep 'inet addr' |awk -F: '{split($2,a," "); print a[1] }')
+ip_addr=$(ip route get $gateway | awk '/src/{print $NF}')
hostname=$(cat /etc/hostname)
# Set the PATH to use the LAVA api
@@ -45,16 +45,9 @@ EOF
IRC_AVAILABLE=false
if [ ! -z "${IRC_USER}" ]; then
- if apt-get install -qq python-irc; then
- IRC_AVAILABLE=true
- TMP_IRC_USER=hs-${RANDOM}
- # make a unique user
- cat <<EOF | python /usr/share/doc/python-irc/examples/irccat2.py ${IRC_SERVER} ${TMP_IRC_USER} ${IRC_USER}
-Your hacking session is now ready
-Please connect to:
-${SSH_COMMAND}
-EOF
- fi
+ IRC_AVAILABLE=true
+ TMP_IRC_USER=hs-${RANDOM}
+ echo -e "\n\nNICK ${TMP_IRC_USER}\nUSER ${TMP_IRC_USER} 8 * :LAVA Hacking\nPRIVMSG ${IRC_USER} : ${SSH_COMMAND}\nQUIT \n" | nc -i 1 i${IRC_SERVER} 6667
fi
if [ ! -z "${NOTIFY_URL}" ]; then
if apt-get install -qq wget; then