Revert make-iptables-restore to r167 (previous revert has gone too far)
[svn/Prometheus-QoS/.git] / optional-tools / make-pimp
index 563725dd05367f91b2e50dfe2a3cadcad357540c..8bc77a0bc7832a5232c6c3db1efa367218886735 100755 (executable)
@@ -1,16 +1,15 @@
 #!/bin/bash
 #!/bin/bash
-pimp=/rw/etc/pimp.conf
-etchosts=/rw/etc/hosts
+# $Id$
+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`
-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 -n "Writing $pimp_2way_nat"
+echo "#This file was generated by Prometheus-tools/make-pimp" > $pimp_2way_nat
+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
+sed -e '/^#/d; /^$/d; /.*(.*)/!d; s/[ \t].*#.*(/ /; s/).*$//' < $etchosts >> $pimp_snat
 echo " done."
 echo " done."
This page took 0.139308 seconds and 4 git commands to generate.