Since you're running as root, you can just use "[ -O ... ]" to test if the file is owned by root.