getipspace.sh 395 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. INPUT=AS.csv
  3. CDNS=data/CDN.csv
  4. OLDIFS=$IFS
  5. IFS=,
  6. programname=$0
  7. LIMIT="none"
  8. build_rules () {
  9. echo "$company"
  10. whois -h whois.radb.net -- "-i origin AS32934" | grep ^route | while read -r ip; do
  11. ip=${ip//[[:blank:]]/}
  12. ip=${ip#"route"}
  13. ip=${ip#"6:"}
  14. ip=${ip#":"}
  15. ip=${ip//[[:blank:]]/}
  16. echo "$ip" >> apple
  17. done
  18. tr '\n' ',' < apple > apple.csv
  19. }
  20. build_rules