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" <