This repository has been archived on 2024-03-04. You can view files and clone it, but cannot push or open issues or pull requests.
linux/.config/bash/module/checksum.sh

26 lines
474 B
Bash

checksum_create()
{
if [[ -f .checksum ]]; then
echo -e "${color_bred}Checksum already exists.${color_default}"
return 1
fi
find -type f | parallel -- sha1sum {} >> .checksum
sed -i "/\.checksum/d" .checksum
}
checksum_check()
{
sha1sum --quiet -c .checksum
}
checksum_update()
{
if [[ ! -f .checksum ]]; then
echo -e "${color_bred}Checksum doesn't exists.${color_default}"
return 1
fi
checksum_check && rm .checksum && checksum_create
}