+# my understanding is this is used to upload to MyPLC
+# details like mac addresses and the like
+# for backwards compatibility, in a best-effort manner,
+# we try and compensate for the disappearance of ifconfig
+( /sbin/ifconfig $ETH_DEVICE || ip address show $ETH_DEVICE ) > $IFCONFIG_OUTPUT
+
+verbose-message "pl_netinit: network online"
+
+# patch for f22 and above - if /etc/resolv.conf is empty or missing
+function pl-netinit-patch-resolv-conf () {
+ file="$1"; shift
+ needed=""
+ # missing file : patch needed
+ if ! [ -f $file ]; then
+ needed=true
+ # empty file : patch needed
+ else
+ contents=$(grep -v '^#' $file)
+ contents=$(echo $contents)
+ [ -z "$contents" ] && needed=true
+ fi
+ if [ -z "$needed" ]; then
+ echo pl_netinit has no need to patch $file
+ return
+ fi
+
+ verbose-message "pl_netinit: patching $file"
+ source /etc/sysconfig/network-scripts/ifcfg-${ETH_DEVICE}
+ # delete because it may be a symlink to /run/systemd/resolve/resolv.conf
+ # which looks really weird (ls -lL /etc/resolv.conf does not show anything)
+ rm -f $file
+ # mention the DNS servers defined in the config - if any
+ [ -n "$DNS1" ] && echo nameserver $DNS1 >> $file
+ [ -n "$DNS2" ] && echo nameserver $DNS2 >> $file
+ # also add landmark for good measure
+ echo "nameserver 8.8.8.8" >> $file
+}