diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2014-09-18 18:44:30 +0100 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2014-11-20 17:00:55 +0000 |
commit | 0cbf2d2a3e02f592b87e805f71800ed5bf863760 (patch) | |
tree | be8c472617245d80801c37e19d0391ad5aa036f7 | |
parent | 2fc1bdc7a06b355a244191c6a4508f5b8710c50b (diff) |
debian hacking session: move irc package into script
It seems the IRC script is only available in some distro versions. By
removing it as a hard dependency we can fail more gracefully. Also if
IRC_USER is not specified we won't even try.
Change-Id: Ibe9b61392d210745930d589392cf6577b6a0565e
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
-rw-r--r-- | hacking-session-debian.yaml | 1 | ||||
-rwxr-xr-x | invoke_session_debian | 11 |
2 files changed, 7 insertions, 5 deletions
diff --git a/hacking-session-debian.yaml b/hacking-session-debian.yaml index f3b2294..47fbee3 100644 --- a/hacking-session-debian.yaml +++ b/hacking-session-debian.yaml @@ -12,7 +12,6 @@ install: deps: - openssh-server - wget - - python-irc run: steps: - ./setup_session_debian "$PUB_KEY" diff --git a/invoke_session_debian b/invoke_session_debian index ba711a1..c01ab48 100755 --- a/invoke_session_debian +++ b/invoke_session_debian @@ -31,16 +31,19 @@ fi SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${REAL_USER}@${ip_addr}" echo "*******************************************************************************************************" +echo "* REAL_USER=${REAL_USER}, USER=${USER}, SUDO_USER=${SUDO_USER}" echo "Please connect to: ${SSH_COMMAND} for access to (${hostname})" echo "*******************************************************************************************************" echo "" -if [ ! -z "${IRC_USER}" -a -e /usr/share/doc/python-irc/examples/irccat2.py ]; then - # make a unique user - cat <<EOF | python /usr/share/doc/python-irc/examples/irccat2.py ${IRC_SERVER} hs-${RANDOM} ${IRC_USER} +if [ ! -z "${IRC_USER}" ]; then + if apt-get install -qq python-irc; then + # make a unique user + cat <<EOF | python /usr/share/doc/python-irc/examples/irccat2.py ${IRC_SERVER} hs-${RANDOM} ${IRC_USER} Your hacking session is now ready Please connect to: -${SSH_COMMAND}" +${SSH_COMMAND} EOF + fi fi echo "" mkdir -p /run |