src/clean-md5-cache: new script

Signed-off-by: Maciej Barć <xgqt@protonmail.com>
This commit is contained in:
Maciej Barć 2020-12-19 20:45:31 +01:00
parent 21476d5b4e
commit 462dab713e
No known key found for this signature in database
GPG Key ID: 031C9FE65BED714A
1 changed files with 22 additions and 0 deletions

22
src/clean-md5-cache Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
# Clean md5-cache from the overlay directory
trap 'exit 128' INT
export PATH
cache="$(git rev-parse --show-cdup)metadata/md5-cache"
if [ -d "${cache}" ]
then
if ! rm -fr "${cache}"
then
sudo rm -fr "${cache}" || exit 1
fi
else
echo "No pre-generated md5-cache found in ${cache}"
fi