Advertisement
Guest User

Untitled

a guest
Feb 2nd, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. while read esxi; \
  2. do ip=$(echo $esxi | awk '{print $1}');fqdn=$(echo $esxi | awk '{print $2}'); \
  3. thumbprint=$(echo -n | openssl s_client -connect $ip:443 2>/dev/null | openssl x509 -noout -fingerprint -sha1|cut -f 2 -d'='); \
  4. echo "govc host.add -hostname=$fqdn -folder=/MYDC/host/spare-hosts -dc=MYDC -username=root -password=\$MYPASSS -thumbprint=$thumbprint"; \
  5. done </tmp/esxi.list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement