feat: changed skel check to use a sum of the structure!

This commit is contained in:
Strix 2023-12-06 22:16:46 +01:00
parent 6d79b38358
commit e8fd022ce5
No known key found for this signature in database
GPG key ID: 5F35B3B8537287A7
4 changed files with 22 additions and 2 deletions

View file

@ -0,0 +1 @@
059c7c3eb87d4a9bd30b70ba9016b875783b9206cbd44b4c2dc1bb8f59787127 -

View file

@ -0,0 +1,12 @@
#!/bin/bash
if ! [ -f "skel/etc/ixvd/skel-sum.txt" ]; then
echo "no skel sum!"
exit 1
fi
sum=$(find skel | sha256sum)
if ! [ "$(cat skel/etc/ixvd/skel-sum.txt)" = "$sum" ]; then
echo "skel sum does not match!"
exit 1
fi

6
tools/repo/skel-sum-update.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
# creates sum of the directory STRUCTURE!!
[ -f "skel/etc/ixvd/skel-sum.txt" ] || echo "none" > skel/etc/ixvd/skel-sum.txt
find skel | sha256sum > skel/etc/ixvd/skel-sum.txt

View file

@ -13,8 +13,9 @@ fi
git pull
[ -f "/etc/ixvd/version" ] && if ! [ "$(cat ./skel/etc/ixvd/version)" = "$(cat /etc/ixvd/version)" ]; then
echo "WARNING: IXVD SKELETON VERSION CHANGED!"
skelsum=$(find skel | sha256sum)
if ! [ "$(cat /etc/ixvd/skel-sum.txt)" = "$skelsum" ]; then
echo "WARNING: IXVD SERVER SKELETON CHANGED!"
echo "WARNING: Manual intervention is required."
exit 1
fi