# Semi usefull hacks to allow quicker scripting on this directories
# under a bash/sh shell.
#
# To use: . one-liners.sh.inc

# Make a big assumption about the genesis tools directory location
SCRIPTROOT="$HOME/wleiden/node-config/genesis/tools"
echo $PATH | grep -q $SCRIPTROOT || export PATH="$PATH:$SCRIPTROOT"

alias allnodes='for F in CNode*; do echo $F.wleiden.net.; done'
alias allproxies='for F in proxy*; do echo $F.wleiden.net.; done'

allwlip() {
cat */wleiden.yaml | grep " ip" | awk -F "[/']" '{print $2}' | grep 172 | sort -u
}

allnonwlip() {
cat */wleiden.yaml | grep " ip" | awk -F "[/']" '{print $2}' | grep -v 172 | sort -u
}

nodestatus() {
  nmap -R -oG - -sP `allnodes` `allproxies` | tee status.txt
}
