From f1d6b8a9d3c06f74e904959887cf043d09aff687 Mon Sep 17 00:00:00 2001 From: Dexter Morgan Date: Thu, 2 Jun 2011 20:51:50 +0000 Subject: Branch for updates --- firewall_wizard/scripts/liste_ext_device.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 firewall_wizard/scripts/liste_ext_device.sh (limited to 'firewall_wizard/scripts/liste_ext_device.sh') diff --git a/firewall_wizard/scripts/liste_ext_device.sh b/firewall_wizard/scripts/liste_ext_device.sh new file mode 100755 index 00000000..042590f0 --- /dev/null +++ b/firewall_wizard/scripts/liste_ext_device.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# script for wizard firewall configuration +# +# return on stdout the list of allowed devices for external network interface + +# this script should be improved + +pdevice=`. ./common/scripts/functions.sh; ./firewall_wizard/scripts/compute_ext_device.sh` + +liste="ppp0\nppp0\nppp1\nppp1\nisdn0\nisdn0\nisdn1\nisdn1\n" + +liste=$liste"`ifconfig -a | awk ' /^eth/ { print $1"\n"$1, $4,":",$5 } '`\n" + +#for i in 0 1 2 3 ;do +# liste=${liste}"eth$i\nethernet adapter \ +# `ifconfig -a | grep eth$i| sed -n -e '1{s/.*HWaddr \(.*\)$/\1/p;}'`\n" + +# liste=${liste}"eth$i\neth$i \ +# `dmesg | grep eth$i| sed -n -e '1{s/^[^:]*: *\(.*\)$/\1/p;}'`\n" +#done + +test=`echo "${liste}" | grep ${pdevice}` + +[ -z "${test}" ] && liste="${pdevice}\n"${liste} + +echo -ne "${liste}" + +exit 0 + -- cgit v1.2.1