SNAT-only (firwalled) version of public-ip mapping (/optional-tools/make-snat-dnat...
[svn/Prometheus-QoS/.git] / optional-tools / make-pimp
index 563725d..6a1d69a 100755 (executable)
@@ -1,15 +1,29 @@
 #!/bin/bash
-pimp=/rw/etc/pimp.conf
-etchosts=/rw/etc/hosts
+pimp_2way_nat="/rw/var/run/pimp-2way-nat.tmp"
+pimp_snat="/rw/var/run/pimp-snat.tmp"
+etchosts="/rw/etc/hosts"
 
-echo -n "Writing $pimp "
-echo "#This is $pimp generated by Prometheus-tools/make-pimp" > $pimp
+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
+  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 "(" $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
This page took 0.127595 seconds and 4 git commands to generate.