#!/bin/bash
function GetIP() {
  while read -u $1 Anfrage; do
    tmp="${Anfrage%% *}"
    IP[1]="${tmp%%.*}"
    IP[4]="${tmp##*.}"
    tmp="${tmp%.*}"
    IP[3]="${tmp##*.}"
    tmp="${tmp%.*}"
    IP[2]="${tmp##*.}"
    printf "%03d.%03d.%03d.%03d\n" ${IP[1]} ${IP[2]} ${IP[3]} ${IP[4]}
  done
}
exec 3<access.log
GetIP 3 | sort | uniq
