for mod in /sys/module/rt2??0/ ; do
if [ -d "$mod" ]; then
- IWPREUPLINE="$IWPREUPLINE pre-up /sbin/ifconfig $DV up\n"
+ IWPREUPLINE="$IWPREUPLINE pre-up /sbin/ip link set $DV up\n"
break
fi
done
# Executing this script generates an entry in /etc/udev/rules.d/z25_persistent-net.rules
# for you, please check z25_persistent-net.rules for existing entries before
# running this script (once more)." > /etc/udev/scripts/netcardconfig
- for interface in $(ifconfig | awk '/^[a-z]/ &&!/^lo/{ print $1} ') ; do
+ for interface in $(ip -oneline link | awk '!/ lo: / {print $2}' | sed 's/:$//; s/@.*//') ; do
echo -n "INTERFACE=$interface /lib/udev/write_net_rules " >> /etc/udev/scripts/netcardconfig && \
if which udevadm >/dev/null 2>&1; then
udevadm info -a -p "/sys/class/net/$interface" | awk -F'==' '/address/ {print $2}' >> /etc/udev/scripts/netcardconfig
scanwlan(){
i=0
- ifconfig "$DV" up
+ ip link set "$DV" up
iwlist "$DV" scanning | grep "ESSID\|Quality" | sed -e "s/^.*ESSID:\"\|\"$//g" | tac > "$TMP"
while read -r line
do
fi
# Configure VLAN on this interface?
- if $DIALOG --yesno "$MESSAGE16" 8 45; then
+ if $DIALOG --defaultno --yesno "$MESSAGE16" 8 45; then
$DIALOG --inputbox "$MESSAGE17 $DV" 10 45 2>"$TMP" || bailout 1
read -r VLAN <"$TMP" ; rm -f "$TMP"
if [ -n "$VLAN" ]; then
+ modprobe 8021q # avoid warning that VLAN support isn't present yet
PDV=$DV
DV="vlan$VLAN"
fi
WLAN_NEW=( $(for i in /sys/class/net/* ; do ( [ -d "$i/wireless" ] || [ -d "$i/phy80211" ] ) && basename "$i" ; done) )
set -a WLAN_IWCONFIG
for DEV in $LAN ; do
- iwconfig $DEV 2>/dev/null 1>&2 && WLAN_IWCONFIG+=($DEV)
+ iwconfig "${DEV}" 2>/dev/null 1>&2 && WLAN_IWCONFIG+=("${DEV}")
done
WLAN=( $(echo "${WLAN_OLD[@]}" "${WLAN_NEW[@]}" "${WLAN_IWCONFIG[@]}" | tr ' ' '\n' | sort -u) )
fi
((NETDEVICESCOUNT++))
done < <(ip link show | awk ' !/^\s/{sub(/:/,"",$2);IFACE=$2} /link.ether/{if (IFACE !~/^vmnet/) print IFACE" "$2}')
for dev in $LAN; do
- if [ "$(ethtool -i $dev 2>/dev/null|awk '/^bus-info:/{print $2}')" == "ieee1394" ]; then
+ if [ "$(ethtool -i "${dev}" 2>/dev/null|awk '/^bus-info:/{print $2}')" == "ieee1394" ]; then
isauto="0"
- grep auto /etc/network/interfaces | grep -q $dev && isauto="1"
- NETDEVICES[$NETDEVICESCOUNT]="$dev A::$isauto D::$(ethtool -i $dev 2>/dev/null|awk '/^driver:/{print $2}') W::0 F::1"
+ grep auto /etc/network/interfaces | grep -q "${dev}" && isauto="1"
+ NETDEVICES[$NETDEVICESCOUNT]="${dev} A::${isauto} D::$(ethtool -i "${dev}" 2>/dev/null|awk '/^driver:/{print $2}') W::0 F::1"
((NETDEVICESCOUNT++))
fi
done