From 65074c16ed678e91cf12786d49dcac5ec3a71342 Mon Sep 17 00:00:00 2001 From: zeus Date: Fri, 5 Mar 2021 14:29:03 +0200 Subject: [PATCH] docs --- .../usr/share/swarmlab.io/sec/project/bin/swarmlab-nmap | 6 ++++++ install/usr/share/swarmlab.io/sec/swarmlab-sec | 9 +++++++++ 2 files changed, 15 insertions(+) create mode 100755 install/usr/share/swarmlab.io/sec/project/bin/swarmlab-nmap diff --git a/install/usr/share/swarmlab.io/sec/project/bin/swarmlab-nmap b/install/usr/share/swarmlab.io/sec/project/bin/swarmlab-nmap new file mode 100755 index 0000000..5f54ecf --- /dev/null +++ b/install/usr/share/swarmlab.io/sec/project/bin/swarmlab-nmap @@ -0,0 +1,6 @@ +#/bin/sh + +#ip=`nslookup hybrid-mpi_master_1.hybrid-mpi_hybrid-mpi | grep Addr | cut -d':' -f2 | grep -v 127.0.` +ip=`nslookup $NODENAME | grep Addr | cut -d':' -f2 | grep -v 127.0.` +nmap -sn -oG - $ip/24 | grep Up | grep $NODENETWORK | cut -d ' ' -f 2 + diff --git a/install/usr/share/swarmlab.io/sec/swarmlab-sec b/install/usr/share/swarmlab.io/sec/swarmlab-sec index 7d3999a..4def545 100755 --- a/install/usr/share/swarmlab.io/sec/swarmlab-sec +++ b/install/usr/share/swarmlab.io/sec/swarmlab-sec @@ -77,6 +77,8 @@ IMAGE_origin="ubuntu:18.04" bootstrap="sec_bootstrap" hostnames="auto_update_hosts" hostnames_get="get_hosts" +NODENAME=${HYBRID_NETWORK}_master_1.${HYBRID_NETWORK}_${HYBRID_NETWORK} +NODENETWORK=${HYBRID_NETWORK} # shellcheck disable=SC1091 #. ./.env @@ -343,6 +345,7 @@ fi /bin/mkdir -p $Wdir/project +/bin/cp -rf $DIR/project/bin $Wdir/project /bin/cp -f $DIR/project/hello_world.sh $Wdir/project /bin/cp -f $DIR/$bootstrap $Wdir/$bootstrap /bin/cp -f $DIR/$hostnames $Wdir/$hostnames @@ -364,6 +367,9 @@ services: master: image: $REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME privileged: true + environment: + - NODENAME=${NODENAME} + - NODENETWORK=${NODENETWORK} cap_add: - NET_ADMIN user: root @@ -379,6 +385,9 @@ services: worker: image: $REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME privileged: true + environment: + - NODENAME=${NODENAME} + - NODENETWORK=${NODENETWORK} cap_add: - NET_ADMIN user: root