feat: changed skel check to use a sum of the structure!
This commit is contained in:
parent
6d79b38358
commit
e8fd022ce5
4 changed files with 22 additions and 2 deletions
1
skel/etc/ixvd/skel-sum.txt
Normal file
1
skel/etc/ixvd/skel-sum.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
059c7c3eb87d4a9bd30b70ba9016b875783b9206cbd44b4c2dc1bb8f59787127 -
|
12
tools/repo/check.d/40-skel-sum.sh
Executable file
12
tools/repo/check.d/40-skel-sum.sh
Executable 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
6
tools/repo/skel-sum-update.sh
Executable 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
|
|
@ -13,8 +13,9 @@ fi
|
||||||
|
|
||||||
git pull
|
git pull
|
||||||
|
|
||||||
[ -f "/etc/ixvd/version" ] && if ! [ "$(cat ./skel/etc/ixvd/version)" = "$(cat /etc/ixvd/version)" ]; then
|
skelsum=$(find skel | sha256sum)
|
||||||
echo "WARNING: IXVD SKELETON VERSION CHANGED!"
|
if ! [ "$(cat /etc/ixvd/skel-sum.txt)" = "$skelsum" ]; then
|
||||||
|
echo "WARNING: IXVD SERVER SKELETON CHANGED!"
|
||||||
echo "WARNING: Manual intervention is required."
|
echo "WARNING: Manual intervention is required."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue