← Commit list

7180d9ed8

Rolf Eike Beer
Rolf Eike Beer
2019-04-13
SUCCESS Duration: 152s

Subject

examples/udhcp/simple.script: fix resolv.conf update if it is a dangling symlink

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

examples/udhcp/simple.script+4 -0
@@ -55,6 +55,10 @@ case "$1" in
echo "Recreating $RESOLV_CONF"
# If the file is a symlink somewhere (like /etc/resolv.conf
# pointing to /run/resolv.conf), make sure things work.
+ if test -L "$RESOLV_CONF"; then
+ # If it's a dangling symlink, try to create the target.
+ test -e "$RESOLV_CONF" || touch "$RESOLV_CONF"
+ fi
realconf=$(readlink -f "$RESOLV_CONF" 2>/dev/null || echo "$RESOLV_CONF")
tmpfile="$realconf-$$"
> "$tmpfile"