Add empty check
This commit is contained in:
parent
5af054ddc9
commit
432d5e1242
@ -5,8 +5,12 @@ set -e
|
|||||||
has_error=0
|
has_error=0
|
||||||
for file in $@ ; do
|
for file in $@ ; do
|
||||||
head -1 "$file" | grep --quiet '^\$ANSIBLE_VAULT;' || {
|
head -1 "$file" | grep --quiet '^\$ANSIBLE_VAULT;' || {
|
||||||
|
if [ -s "$file" ]; then
|
||||||
echo "ERROR: $file is not encrypted"
|
echo "ERROR: $file is not encrypted"
|
||||||
has_error=1
|
has_error=1
|
||||||
|
else
|
||||||
|
echo "WARNING: $file is not encrypted but is empty"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user