indexed SNAT/DNAT optimized for /dev/shm, 3xB (/16) private addreseses and 3 wan...
[svn/Prometheus-QoS/.git] / optional-tools / make-pimp
CommitLineData
a4f661fc 1#!/bin/bash
3a4fe273 2pimp_2way_nat="/dev/shm/pimp-2way-nat.tmp"
3pimp_snat="/dev/shm/pimp-snat.tmp"
86d37066 4etchosts="/mnt/mtdblock0/hosts"
a4f661fc 5
f035230d 6echo -n "Writing $pimp_2way_nat"
7echo "#This file was generated by Prometheus-tools/make-pimp" > $pimp_2way_nat
7b3d7570 8for czfip in `grep -v ^# $etchosts|grep [[]|cut -f 1`
a4f661fc 9do
10 pubip=`grep "^$czfip " $etchosts|cut -f 2 -d "["|cut -f 1 -d "]"`
11 if ! [ -z $pubip ]
12 then
f035230d 13 echo "$czfip $pubip" >> $pimp_2way_nat
14 echo -n .
15 fi
16done
17echo " done."
18
19echo -n "Writing $pimp_snat"
20echo "#This file was generated by Prometheus-tools/make-pimp" > $pimp_snat
7b3d7570 21for czfip in `grep -v ^# $etchosts|grep "("|cut -f 1`
f035230d 22do
23 pubip=`grep "^$czfip " $etchosts|cut -f 2 -d "("|cut -f 1 -d ")"`
86d37066 24 if ! [ -z "$pubip" ]
f035230d 25 then
26 echo "$czfip $pubip" >> $pimp_snat
a4f661fc 27 echo -n .
28 fi
29done
30echo " done."
This page took 0.140948 seconds and 4 git commands to generate.