summaryrefslogtreecommitdiffstats
path: root/firewall_wizard/scripts/liste_ext_device.sh
blob: 042590f0200e7b81dc3762a6e499cdd9cf4011ec (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
26
27
28
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