#!/bin/bash pimp=/rw/etc/pimp.conf etchosts=/rw/etc/hosts echo -n "Writing $pimp " echo "#This is $pimp generated by Prometheus-tools/make-pimp" > $pimp for czfip in `grep [[] $etchosts|cut -f 1` do pubip=`grep "^$czfip " $etchosts|cut -f 2 -d "["|cut -f 1 -d "]"` if ! [ -z $pubip ] then echo "$czfip $pubip" >> $pimp echo -n . fi done echo " done."