2
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
3
# Released under the 2-clause BSD license.
5
description="Saves the caches OpenRC uses to non volatile storage"
9
if [ -e "$RC_SVCDIR"/clock-skewed ]; then
10
ewarn "WARNING: clock skew detected!"
11
if ! yesno "${RC_GOINGDOWN}"; then
12
eerror "Not saving deptree cache"
16
if ! checkpath -W "$RC_LIBEXECDIR"; then
17
ewarn "WARNING: ${RC_LIBEXECDIR} is not writable!"
18
if ! yesno "${RC_GOINGDOWN}"; then
19
ewarn "Unable to save deptree cache"
24
ebegin "Saving dependency cache"
26
if [ ! -d "$RC_LIBEXECDIR"/cache ]; then
27
rm -rf "$RC_LIBEXECDIR"/cache
28
if ! mkdir "$RC_LIBEXECDIR"/cache; then
30
if yesno "${RC_GOINGDOWN}"; then
38
for x in deptree depconfig shutdowntime softlevel nettree rc.log; do
39
[ -e "$RC_SVCDIR/$x" ] && save="$save $RC_SVCDIR/$x"
41
if [ -n "$save" ]; then
42
cp -p $save "$RC_LIBEXECDIR"/cache 2>/dev/null
45
if yesno "${RC_GOINGDOWN}"; then