Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/examples/udhcp


Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (8 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/examples/udhcp/sample.bound

    r2725 r3621  
    2323fi
    2424
    25 echo -n > $RESOLV_CONF
    26 [ -n "$domain" ] && echo domain $domain >> $RESOLV_CONF
    27 for i in $dns
    28 do
    29     echo adding dns $i
    30     echo nameserver $i >> $RESOLV_CONF
    31 done
     25# Only replace resolv.conf is we have at least one DNS server
     26if [ -n "$dns" ]
     27then
     28    echo -n > $RESOLV_CONF
     29    [ -n "$domain" ] && echo domain $domain >> $RESOLV_CONF
     30    for i in $dns
     31    do
     32        echo adding dns $i
     33        echo nameserver $i >> $RESOLV_CONF
     34    done
     35fi
  • branches/3.3/mindi-busybox/examples/udhcp/sample.renew

    r2725 r3621  
    2323fi
    2424
    25 echo -n > $RESOLV_CONF
    26 [ -n "$domain" ] && echo domain $domain >> $RESOLV_CONF
    27 for i in $dns
    28 do
    29     echo adding dns $i
    30     echo nameserver $i >> $RESOLV_CONF
    31 done
     25# Only replace resolv.conf is we have at least one DNS server
     26if [ -n "$dns" ]
     27then
     28    echo -n > $RESOLV_CONF
     29    [ -n "$domain" ] && echo domain $domain >> $RESOLV_CONF
     30    for i in $dns
     31    do
     32        echo adding dns $i
     33        echo nameserver $i >> $RESOLV_CONF
     34    done
     35fi
  • branches/3.3/mindi-busybox/examples/udhcp/simple.script

    r2725 r3621  
    3030            for i in $router ; do
    3131                echo "Adding router $i"
    32                 route add default gw $i dev $interface metric $((metric++))
     32                route add default gw $i dev $interface metric $metric
     33                : $(( metric += 1 ))
    3334            done
    3435        fi
    3536
    3637        echo "Recreating $RESOLV_CONF"
    37         echo -n > $RESOLV_CONF-$$
    38         [ -n "$domain" ] && echo "search $domain" >> $RESOLV_CONF-$$
     38        # If the file is a symlink somewhere (like /etc/resolv.conf
     39        # pointing to /run/resolv.conf), make sure things work.
     40        realconf=$(readlink -f "$RESOLV_CONF" 2>/dev/null || echo "$RESOLV_CONF")
     41        tmpfile="$realconf-$$"
     42        > "$tmpfile"
     43        [ -n "$domain" ] && echo "search $domain" >> "$tmpfile"
    3944        for i in $dns ; do
    4045            echo " Adding DNS server $i"
    41             echo "nameserver $i" >> $RESOLV_CONF-$$
     46            echo "nameserver $i" >> "$tmpfile"
    4247        done
    43         mv $RESOLV_CONF-$$ $RESOLV_CONF
     48        mv "$tmpfile" "$realconf"
    4449        ;;
    4550esac
Note: See TracChangeset for help on using the changeset viewer.