savecache: clean up creation of cache directory

The cache directory should be created via mkdir -p instead of
mkdir. This makes sure all parent directories are created.

Also, we now display an error message explaining that we were unable to
create the cache directory if creation fails.
This commit is contained in:
William Hubbs 2015-04-21 18:56:39 -05:00
parent de7d184909
commit 23d806ca24

View File

@ -25,12 +25,12 @@ start()
local rc= local rc=
if [ ! -d "$RC_LIBEXECDIR"/cache ]; then if [ ! -d "$RC_LIBEXECDIR"/cache ]; then
rm -rf "$RC_LIBEXECDIR"/cache rm -rf "$RC_LIBEXECDIR"/cache
if ! mkdir "$RC_LIBEXECDIR"/cache; then if ! mkdir -p "$RC_LIBEXECDIR"/cache; then
rc=$? rc=$?
if yesno "${RC_GOINGDOWN}"; then if yesno "${RC_GOINGDOWN}"; then
rc=0 rc=0
fi fi
eend $rc eend $rc "Unable to create $RC_SVCDIR/cache"
return $rc return $rc
fi fi
fi fi