Improve var dir creation.
authorRoy Marples <roy@marples.name>
Fri, 9 Nov 2007 13:23:40 +0000 (13:23 +0000)
committerRoy Marples <roy@marples.name>
Fri, 9 Nov 2007 13:23:40 +0000 (13:23 +0000)
resolvconf

index 9c630aeef927656ecbba7da25bf7fe0504256491..5f546c2b0c16b3db8d554a2a1a8a83d4e4f800f4 100755 (executable)
@@ -200,13 +200,17 @@ fi
 if [ ! -d "${IFACEDIR}" ]; then
        if [ ! -d "${VARDIR}" ]; then
                if [ -L "${VARDIR}" ]; then
-                       DIR="$(readlink -f "${VARDIR}")"
-                       [ -z "${DIR}" ] && DIR="$(readlink "${VARDIR}")"
+                       DIR="$(readlink "${VARDIR}")"
+                       # Change to /etc as link maybe relative
+                       cd "${VARDIR%/*}"
+                       if ! mkdir -m 0755 -p "${DIR}"; then
+                               error_exit "Failed to create needed directory ${DIR}"
+                       fi
+               else
+                       if ! mkdir -m 0755 -p "${VARDIR}"; then
+                               error_exit "Failed to create needed directory ${VARDIR}"
+                       fi
                fi
-               # Change to /etc as link maybe relative
-               cd "${VARDIR%/*}"
-               mkdir -m 0755 -p "${DIR}" \
-                       || error_exit "Failed to create needed directory ${DIR}"
        fi
        mkdir -m 0755 -p "${IFACEDIR}" || \
                error_exit "Failed to create needed directory ${IFACEDIR}"