3
0
mirror of https://github.com/rvalitov/zabbix-php-fpm.git synced 2023-11-05 03:30:27 +01:00

[add] check if cache file is writeable

This commit is contained in:
Ramil Valitov 2020-01-18 23:04:53 +03:00
parent 0af188ec6d
commit 1d4f9a8544
No known key found for this signature in database
GPG Key ID: 645768E8FD0E18C7

View File

@ -322,6 +322,11 @@ do
fi
done
if [[ -f ${CACHE_FILE} ]] && [[ ! -w ${CACHE_FILE} ]]; then
${S_ECHO} "Error: write permission is not granted to user $ACTIVE_USER for cache file $CACHE_FILE"
exit 1
fi
PrintDebug "Saving new cache file $CACHE_FILE..."
${S_PRINTF} "%s\n" "${NEW_CACHE[@]}" > ${CACHE_FILE}