diff options
Diffstat (limited to 'firewall_wizard/scripts/liste_ext_device.sh')
-rwxr-xr-x | firewall_wizard/scripts/liste_ext_device.sh | 29 |
1 files changed, 29 insertions, 0 deletions
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 + |