Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 4dc36827 authored by Guillaume Mella's avatar Guillaume Mella
Browse files

fix error in VM-OSUG-DC-05

parent 2c73df0a
#!/bin/bash
#
# Read a list of vlan and walk through every ips inside.
# Output oneline per vlan and one line per ip that get a DNS record (in dokuwiki format)
#
# I like in this script:
# - the computation of the size of a given vlan given to it's network address
#
#Plages Nom du VLAN
......@@ -17,7 +23,9 @@ VLANS="129.88.191.0/24 SPR-OSUG
152.77.135.104/30 VM-OSUG-MONITORING
152.77.135.144/28 VM-OSUG-DC-INFRA
152.77.135.160/27 VM-OSUG-DC-04
152.77.135.160/27 VM-OSUG-DC-05"
152.77.135.192/27 VM-OSUG-DC-05"
#VLANS="152.77.114.192/26 VLAN OSUG-SRV"
#VLANS="152.77.135.192/27 VM-OSUG-DC-05"
skipExpr="x670-bio-cermo\|spring-tn-osug"
......@@ -27,9 +35,15 @@ handleIp(){
if HOSTR=$(host $IP)
then
HOST=${HOSTR##* }
if ping -c 1 $IP &>/dev/null
then
PING="ping"
else
PING=""
fi
if ! echo $HOST | grep $skipExpr &> /dev/null
then
echo "|$IP|$HOST| |"
echo "|$IP|$HOST| $PING |"
fi
fi
}
......@@ -40,14 +54,14 @@ handleVlan(){
LPART=${ADDRESS%%/*}
NETSIZE=${ADDRESS##*/}
IPSUFFIX=${LPART%.*}
RIP=${LPART##*.}
let FROM="$RIP"
NETWORKPREFIX=${LPART%.*}
NETWORKSUFFIX=${LPART##*.}
let FROM="$NETWORKSUFFIX"
let TO="$FROM+2**(32-$NETSIZE)-2"
echo -e "^VLAN $NAME | $IPSUFFIX.$FROM -> $IPSUFFIX.$TO | Note |"
echo -e "^VLAN $NAME | $NETWORKPREFIX.$FROM -> $NETWORKPREFIX.$TO | Note |"
for IPNUM in $(seq $FROM $TO)
do
IP=$IPSUFFIX.$IPNUM
IP=$NETWORKPREFIX.$IPNUM
handleIp $IP
done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment