summarylogtreecommitdiffstats
path: root/20-net-tools-ifconfig-format-change.patch
blob: 0037fbd035023eb488b53448a035c023a7d36218 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--- firestarter-1.0.3/src/scriptwriter.c
+++ firestarter-1.0.3/src/scriptwriter.c
@@ -88,16 +88,16 @@
 	fprintf (f, "\n# --(Extract Network Information)--\n\n");
 
 	fprintf (f, "# External network interface data\n"
-		    "IP=`/sbin/ifconfig $IF | grep inet | cut -d : -f 2 | cut -d \\  -f 1`\n"
-		    "MASK=`/sbin/ifconfig $IF | grep Mas | cut -d : -f 4`\n"
-		    "BCAST=`/sbin/ifconfig $IF |grep Bcast: | cut -d : -f 3 | cut -d \\  -f 1`\n"
+		    "IP=`/sbin/ifconfig $IF | grep inet | tr -s ' ' | cut -d \\  -f 3`\n"
+		    "MASK=`/sbin/ifconfig $IF | grep netmask | tr -s ' ' | cut -d \\  -f 5`\n"
+		    "BCAST=`/sbin/ifconfig $IF | grep broadcast | tr -s ' ' | cut -d \\  -f 7`\n"
 		    "NET=$IP/$MASK\n\n");
 
 	fprintf (f, "if [ \"$NAT\" = \"on\" ]; then\n"
 		    "	# Internal network interface data\n"
-		    "	INIP=`/sbin/ifconfig $INIF | grep inet | cut -d : -f 2 | cut -d \\  -f 1`\n"
-		    "	INMASK=`/sbin/ifconfig $INIF | grep Mas | cut -d : -f 4`\n"
-		    "	INBCAST=`/sbin/ifconfig $INIF |grep Bcast: | cut -d : -f 3 | cut -d \\  -f 1`\n"
+		    "	INIP=`/sbin/ifconfig $INIF | grep inet | tr -s ' ' | cut -d \\  -f 3`\n"
+		    "	INMASK=`/sbin/ifconfig $INIF | grep netmask | tr -s ' ' | cut -d \\  -f 5`\n"
+		    "	INBCAST=`/sbin/ifconfig $INIF | grep broadcast | tr -s ' ' | cut -d \\  -f 7`\n"
 		    "	INNET=$INIP/$INMASK\n"
 		    "fi\n\n");