functions: Add clean cache function
This commit is contained in:
parent
3afb37e6a7
commit
f1385304eb
|
@ -82,6 +82,10 @@ arguments() {
|
||||||
cleanraw
|
cleanraw
|
||||||
exit $? ;;
|
exit $? ;;
|
||||||
|
|
||||||
|
-w | --cleancache)
|
||||||
|
cleancache
|
||||||
|
exit $? ;;
|
||||||
|
|
||||||
-h | -help | --help)
|
-h | -help | --help)
|
||||||
usage
|
usage
|
||||||
exit $? ;;
|
exit $? ;;
|
||||||
|
@ -107,6 +111,9 @@ usage() {
|
||||||
# Clean raw images
|
# Clean raw images
|
||||||
$0 --cleanraw or -r
|
$0 --cleanraw or -r
|
||||||
|
|
||||||
|
# Clean cache
|
||||||
|
$0 --cleancache or -w
|
||||||
|
|
||||||
# Build LNIBUILD
|
# Build LNIBUILD
|
||||||
$0 <path/to/LNIBUILD>
|
$0 <path/to/LNIBUILD>
|
||||||
EOF
|
EOF
|
||||||
|
@ -142,6 +149,15 @@ cleanraw()
|
||||||
rm ./raw/* -f && log "Done!"
|
rm ./raw/* -f && log "Done!"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cleancache()
|
||||||
|
{
|
||||||
|
find ./cache/ -mindepth 1 -maxdepth 1 | read || {
|
||||||
|
[ -z ${quiet+x} ] && log "Nothing to clean" error
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
rm ./cache/* -f && log "Done!"
|
||||||
|
}
|
||||||
|
|
||||||
# shellcheck disable=SC2317
|
# shellcheck disable=SC2317
|
||||||
_shutdown()
|
_shutdown()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue