#!/bin/bash

ENABLED=no
[ "$ENABLED" != "yes" ] && exit 0

export PATH=.:/:/usr/sbin:/usr/bin:/sbin:/bin
DEBUGMODE=no
. usr/lib/ublinux/functions
debug_mode "$0" "$@"

#[ "$DNS_RENEW" = "yes" -a -f /mnt/live/etc/resolv.conf ] && cat /mnt/live/etc/resolv.conf >> /etc/resolvconf/resolv.conf.d/head

NETDEV=$(grep "e.*:[[:space:]]*[1-9]" /proc/net/dev | awk -F: '{print $1}' | head -1 | tr -d ' ')
[ -z "$NETDEV" ] && NETDEV=$(ls /sys/class/net/e*/address | awk -F/ '{print $5}' | head -1)
#[ -z "$NETDEV" ] || sed -i s/DEVICE=.*/DEVICE=$NETDEV/ /etc/ublinux/network-scripts/ifcfg-eth0

#if egrep -q " nfs |httpfs|ftpfs|sshfs| cifs " /proc/mounts ;then
#   sed -i s/ONBOOT=.*/ONBOOT=no/ /etc/ublinux/network-scripts/ifcfg-eth0
#   sed -i s/NM_CONTROLLED=.*/NM_CONTROLLED=no/ /etc/ublinux/network-scripts/ifcfg-eth0
#fi

[ "$(cmdline_parameter flightmode)" ] && rfkill block all
