X-Git-Url: http://git.harvie.cz/?p=svn%2FPrometheus-QoS%2F.git;a=blobdiff_plain;f=optional-tools%2Fmake-pimp;h=0d53c9505bfe93f03e328b33b06e32bc0d8c4e39;hp=6a1d69aaa2a7c98716efd37292a3fb5799ca44c5;hb=4deb2d6f2b43232cf5e782ebb1deb9b0e041def9;hpb=f035230d28accdddb1e3043400246369bdff590d diff --git a/optional-tools/make-pimp b/optional-tools/make-pimp index 6a1d69a..0d53c95 100755 --- a/optional-tools/make-pimp +++ b/optional-tools/make-pimp @@ -1,30 +1,15 @@ #!/bin/bash -pimp_2way_nat="/rw/var/run/pimp-2way-nat.tmp" -pimp_snat="/rw/var/run/pimp-snat.tmp" -etchosts="/rw/etc/hosts" +# $Id: make-pimp 166 2012-05-12 18:15:42Z aquarius $ +pimp_2way_nat="/dev/shm/pimp-2way-nat.tmp" +pimp_snat="/dev/shm/pimp-snat.tmp" +etchosts="/mnt/mtdblock0/hosts" echo -n "Writing $pimp_2way_nat" echo "#This file was generated by Prometheus-tools/make-pimp" > $pimp_2way_nat -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_2way_nat - echo -n . - fi -done +sed -e '/^#/d; /^$/d; /.*\[.*\]/!d; s/[ \t].*#.*\[/ /; s/\].*$//' < $etchosts >> $pimp_2way_nat echo " done." echo -n "Writing $pimp_snat" echo "#This file was generated by Prometheus-tools/make-pimp" > $pimp_snat -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_snat - echo -n . - fi -done +sed -e '/^#/d; /^$/d; /.*(.*)/!d; s/[ \t].*#.*(/ /; s/).*$//' < $etchosts >> $pimp_snat echo " done."