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:
parent
de7d184909
commit
23d806ca24
@ -25,12 +25,12 @@ start()
|
||||
local rc=
|
||||
if [ ! -d "$RC_LIBEXECDIR"/cache ]; then
|
||||
rm -rf "$RC_LIBEXECDIR"/cache
|
||||
if ! mkdir "$RC_LIBEXECDIR"/cache; then
|
||||
if ! mkdir -p "$RC_LIBEXECDIR"/cache; then
|
||||
rc=$?
|
||||
if yesno "${RC_GOINGDOWN}"; then
|
||||
rc=0
|
||||
fi
|
||||
eend $rc
|
||||
eend $rc "Unable to create $RC_SVCDIR/cache"
|
||||
return $rc
|
||||
fi
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user