From 24b7de34993da6466fd567790f69f632b8c616a5 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Thu, 19 Mar 2015 17:20:49 +0100 Subject: [PATCH] added some script for the live usb image --- contrib/liveusb/chroot.sh | 10 +++++++++ contrib/liveusb/setup.sh | 43 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100755 contrib/liveusb/chroot.sh create mode 100755 contrib/liveusb/setup.sh diff --git a/contrib/liveusb/chroot.sh b/contrib/liveusb/chroot.sh new file mode 100755 index 000000000..6e02c1bed --- /dev/null +++ b/contrib/liveusb/chroot.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +mount /dev/sdb1 /media/usb + +for part in dev sys proc; do + umount /media/usb/$part + mount -o bind /$part /media/usb/$part +done + +chroot /media/usb diff --git a/contrib/liveusb/setup.sh b/contrib/liveusb/setup.sh new file mode 100755 index 000000000..62c46b1c7 --- /dev/null +++ b/contrib/liveusb/setup.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +set -e + +RECEIPENTS="stvogel@eonerc.rwth-aachen.de,mstevic@eonerc.rwth-aachen.de" +FROM="Simulator2Simulator Server " + +SERVER=tux.0l.de +USER=acs + +PORT=$(shuf -i 60000-65535 -n 1) + +IP=$(curl -s http://ifconfig.me) + +# check if system has net connectivity. otherwise die... +ssh -q -o ConnectTimeout=2 $USER@$SERVER + +# setup SSH tunnel for mail notification +ssh -f -N -L 25:localhost:25 $USER@$SERVER +# setup SSH reverse tunnel for remote administration +ssh -f -N -R $PORT:localhost:22 $USER@$SERVER + +# send mail with notification about new node +mail -s "New S2SS node alive: $IP ($HOSTNAME)" -a "From: $FROM" "$RECEIPENTS" <