You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ublinux-init/ublinux/rc.post.d/30-network

27 lines
1.1 KiB

#!/usr/bin/env bash
ENABLED=yes
[[ ${ENABLED} == "yes" ]] || exit 0
DEBUGMODE=no
SOURCE=/usr/lib/ublinux/functions; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0
SOURCE=/usr/lib/ublinux/default; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null || exit 0
SOURCE=${SYSCONF}/config; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null
SOURCE=${SYSCONF}/network; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null
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 grep -Eq " 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
[[ -n $(cmdline_parameter flightmode) ]] && rfkill block all