Updates for packages
This commit is contained in:
26
roles/Yggdrasil/package/yggdrasil-sha256
Executable file
26
roles/Yggdrasil/package/yggdrasil-sha256
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
|
||||
basedir="/srv/yggdrasil"
|
||||
shafile="$basedir""/library.sha256"
|
||||
|
||||
option="$1"
|
||||
|
||||
if [ "$option" == "-h" ] || [ "$option" == "--help" ]; then
|
||||
echo Usage: $0 '[verify]'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$option" != "verify" ]]; then
|
||||
chmod u+w "$basedir"
|
||||
touch "$shafile"
|
||||
chmod u+w "$shafile"
|
||||
find "$basedir" -type f -exec sha256sum {} \; > "$shafile"
|
||||
chmod u-w "$basedir" "$shafile"
|
||||
exit 0;
|
||||
else
|
||||
echo "These files have problems:"
|
||||
sha256sum -c "$shafile";
|
||||
exit $?;
|
||||
fi
|
Reference in New Issue
Block a user