diff options
Diffstat (limited to 'examples/udhcp/simple.script')
-rwxr-xr-x | examples/udhcp/simple.script | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/udhcp/simple.script b/examples/udhcp/simple.script index 53974e6d6..6658fbeef 100755 --- a/examples/udhcp/simple.script +++ b/examples/udhcp/simple.script | |||
@@ -16,9 +16,10 @@ BROADCAST="broadcast +" | |||
16 | 16 | ||
17 | case "$1" in | 17 | case "$1" in |
18 | deconfig) | 18 | deconfig) |
19 | echo "Setting IP address 0.0.0.0 on $interface" | 19 | echo "Clearing IP addresses on $interface, upping it" |
20 | if command -v ip >/dev/null; then | 20 | if command -v ip >/dev/null; then |
21 | ip addr flush dev $interface | 21 | ip addr flush dev $interface |
22 | ip link set dev $interface up | ||
22 | else | 23 | else |
23 | ifconfig $interface 0.0.0.0 | 24 | ifconfig $interface 0.0.0.0 |
24 | fi | 25 | fi |
@@ -52,7 +53,6 @@ case "$1" in | |||
52 | done | 53 | done |
53 | fi | 54 | fi |
54 | 55 | ||
55 | echo "Recreating $RESOLV_CONF" | ||
56 | # If the file is a symlink somewhere (like /etc/resolv.conf | 56 | # If the file is a symlink somewhere (like /etc/resolv.conf |
57 | # pointing to /run/resolv.conf), make sure things work. | 57 | # pointing to /run/resolv.conf), make sure things work. |
58 | if test -L "$RESOLV_CONF"; then | 58 | if test -L "$RESOLV_CONF"; then |
@@ -60,6 +60,7 @@ case "$1" in | |||
60 | test -e "$RESOLV_CONF" || touch "$RESOLV_CONF" | 60 | test -e "$RESOLV_CONF" || touch "$RESOLV_CONF" |
61 | fi | 61 | fi |
62 | realconf=$(readlink -f "$RESOLV_CONF" 2>/dev/null || echo "$RESOLV_CONF") | 62 | realconf=$(readlink -f "$RESOLV_CONF" 2>/dev/null || echo "$RESOLV_CONF") |
63 | echo "Recreating $realconf" | ||
63 | tmpfile="$realconf-$$" | 64 | tmpfile="$realconf-$$" |
64 | > "$tmpfile" | 65 | > "$tmpfile" |
65 | [ -n "$domain" ] && echo "search $domain" >> "$tmpfile" | 66 | [ -n "$domain" ] && echo "search $domain" >> "$tmpfile" |