X-Git-Url: https://git.harvie.cz/?p=svn%2FPrometheus-QoS%2F.git;a=blobdiff_plain;f=optional-tools%2Fmake-pimp;h=fd585693beb54a738aab2f74a465f3f78a1b4221;hp=563725dd05367f91b2e50dfe2a3cadcad357540c;hb=3a4fe2736543d63891a750ac4f92586e04c01d26;hpb=a4f661fc8c4d2ef31306e8d4d6f8b0b310623919 diff --git a/optional-tools/make-pimp b/optional-tools/make-pimp index 563725d..fd58569 100755 --- a/optional-tools/make-pimp +++ b/optional-tools/make-pimp @@ -1,15 +1,29 @@ #!/bin/bash -pimp=/rw/etc/pimp.conf -etchosts=/rw/etc/hosts +pimp_2way_nat="/dev/shm/pimp-2way-nat.tmp" +pimp_snat="/dev/shm/pimp-snat.tmp" +etchosts="/mnt/mtdblock0/hosts" -echo -n "Writing $pimp " -echo "#This is $pimp generated by Prometheus-tools/make-pimp" > $pimp -for czfip in `grep [[] $etchosts|cut -f 1` +echo -n "Writing $pimp_2way_nat" +echo "#This file was generated by Prometheus-tools/make-pimp" > $pimp_2way_nat +for czfip in `grep -v ^# $etchosts|grep [[]|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 "$czfip $pubip" >> $pimp_2way_nat + echo -n . + fi +done +echo " done." + +echo -n "Writing $pimp_snat" +echo "#This file was generated by Prometheus-tools/make-pimp" > $pimp_snat +for czfip in `grep -v ^# $etchosts|grep "("|cut -f 1` +do + pubip=`grep "^$czfip " $etchosts|cut -f 2 -d "("|cut -f 1 -d ")"` + if ! [ -z "$pubip" ] + then + echo "$czfip $pubip" >> $pimp_snat echo -n . fi done