GIT.Harvie.CZ
/
svn
/
Prometheus-QoS
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
version 1.0.0.-a - significat iptables parsing speed improvement
[svn/Prometheus-QoS/.git]
/
optional-tools
/
make-pimp
diff --git
a/optional-tools/make-pimp
b/optional-tools/make-pimp
index cdd62641f125922898268b0575b36bfcf6b08e27..0d53c9505bfe93f03e328b33b06e32bc0d8c4e39 100755
(executable)
--- a/
optional-tools/make-pimp
+++ b/
optional-tools/make-pimp
@@
-1,30
+1,15
@@
#!/bin/bash
#!/bin/bash
-pimp_2way_nat="/mnt/mtdblock0/pimp-2way-nat.tmp"
-pimp_snat="/mnt/mtdblock0/pimp-snat.tmp"
+# $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
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 -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_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
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
+sed -e '/^#/d; /^$/d; /.*(.*)/!d; s/[ \t].*#.*(/ /; s/).*$//' < $etchosts >> $pimp_snat
echo " done."
echo " done."
This page took
0.131463 seconds
and
4
git commands to generate.