1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

improved setup script

This commit is contained in:
Steffen Vogel 2015-03-19 17:57:11 +01:00
parent 9cefbaf488
commit d13f19834b

View file

@ -2,15 +2,14 @@
set -e
RECEIPENTS="stvogel@eonerc.rwth-aachen.de,mstevic@eonerc.rwth-aachen.de"
FROM="Simulator2Simulator Server <acs@0l.de>"
RECIPIENTS="stvogel@eonerc.rwth-aachen.de,mstevic@eonerc.rwth-aachen.de"
SERVER=tux.0l.de
USER=acs
PORT=$(shuf -i 60000-65535 -n 1)
IP=$(curl -s http://ifconfig.me)
IP=$(curl -s http://canihazip.com/s)
# check if system has net connectivity. otherwise die...
ssh -q -o ConnectTimeout=2 $USER@$SERVER
@ -21,7 +20,11 @@ ssh -f -N -L 25:localhost:25 $USER@$SERVER
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" <<EOF
sendmail "$RECIPIENTS" <<EOF
Subject: New S2SS node alive: $IP ($HOSTNAME)
From: Simulator2Simulator Server <acs@0l.de>
To: $(RECIPIENTS)
There's a new host with the S2SS LiveUSB Image running:
Reverse SSH tunnel port: $PORT