You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
708 B

#!/bin/bash
echo "Тест наличия файлов"
source library/sh_lib.sh
check=0
files=(
/usr/share/crypto-policies/policies/GOST-ONLY-PAM.pol
/usr/share/crypto-policies/policies/GOST-ONLY.pol
/usr/share/crypto-policies/policies/modules/GOST.pmod
/usr/share/crypto-policies/policies/modules/PAM-GOST.pmod
)
count=${#files[@]}
for (( i=0; i<count; i++ ))
do
ls -l ${files[$i]}
check=$(eq_is_success ${check} 0)
filesize=$(stat -c%s ${files[$i]})
if [ $filesize -eq 0 ]; then
echo "File ${files[$i]} length == 0 -- Error"
let check+=1
else
echo "File ${files[$i]} length == ${filesize} -- OK"
fi
done
check_test_status ${check} "$0"
exit ${check}