You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
start() {
printf"start ethernet: "if [ -e /boot/eth.nodhcp ]
then
[ -e /boot/eth.nodhcp ] &&
cat /boot/eth.nodhcp | grep -v '^#'|whileread inet gw
do
addr=${inet%/*}
netid=${inet#*/}
[ -z$gw ] &&
gw=$(echo$addr| ( IFS='.'read a b c d;echo$(( (((((($a<<8)+$b)<<8)+$c)<<8)+$d) & (((1<<$netid)-1)<<(32-$netid)) ))
)) &&
gw=$(($gw>>24&0xff)).$(($gw>>16&0xff)).$(($gw>>8&0xff)).$((1+( $gw>>0&0xff)))
arping -Dqc2 -Ieth0 $addr||continue
ip a add $inet brd + dev eth0
ip r add default via $gw dev eth0
cat > /etc/resolve.conf <<EOFnameserver $gwnameserver 8.8.8.8nameserver 114.114.114.114EOFbreakdone&&
ip a show dev eth0|grep inet || (
udhcpc -i eth0 -t 3 -T 1 -A 5 -b -p /run/udhcpc.eth0.pid &>/dev/null
ip a show dev eth0|grep inet
) || (
# failed to apply dynamic addr, need a available static addr to visit the LAN
inet=$RESERVE_INET
addr=${inet%/*}
ip a add $inet brd + dev eth0
) ||exit 1
else
(udhcpc -i eth0 -t 10 -T 1 -A 5 -b -p /run/udhcpc.eth0.pid) &fiecho"OK"
}
The text was updated successfully, but these errors were encountered:
Issue:
script file"/etc/init.d/S30eth" fails to handle comments in "/boot/eth.nodhcp"
Suggested fix:
Add a filter to ignore comments in the
/boot/eth.nodhcp
file, using:cat /boot/eth.nodhcp | grep -v '^#' | while read inet gw
Proposed code file "/etc/init.d/S30eth" change:
The text was updated successfully, but these errors were encountered: