Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 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:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • 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.