add function for test ip adresses
This commit is contained in:
parent
517f8fe246
commit
1d09e7368d
2 changed files with 21 additions and 0 deletions
20
functions.sh
20
functions.sh
|
@ -1016,4 +1016,24 @@ vgrename_full () {
|
|||
sed -i "s/${altevolumegroup}/${neuevolumegroup}/g" /etc/initramfs-tools/conf.d/resume
|
||||
update-initramfs -c -k all
|
||||
}
|
||||
|
||||
getfreeip () {
|
||||
|
||||
local N=$1
|
||||
|
||||
sudo nmap -v -sn -n $1 -oG - | awk '/Status: Down/{print $2}'
|
||||
|
||||
}
|
||||
|
||||
getusedip () {
|
||||
|
||||
local N=$1
|
||||
local DNS=$2
|
||||
|
||||
sudo nmap -v -sn -n $1 -oG - | awk '!/Status: Down/{print $2}'|while read i;do
|
||||
echo "$i: $(dig "${DNS:+@}${DNS}" -x $i +short +search)"
|
||||
|
||||
done
|
||||
|
||||
}
|
||||
#EOF
|
||||
|
|
|
@ -5,3 +5,4 @@ $(getbashrcfile) ~/.aliases
|
|||
${MSC_BASE}/aliases
|
||||
${MSC_BASE}/PS1
|
||||
${MSC_BASE}/bash_completion.d/*
|
||||
${MSC_BASE}/bin/getfreeip
|
||||
|
|
Loading…
Reference in a new issue