Code Sample |
function crootp () { # crootp: short for check root priviliges # user and group must be root and permissions must be 600 [ -f $1 ] && [ -G $1 ] && [ -O $1 ] && [ `stat -c %a $1` -eq "600" ] } |
Code Sample |
if crootp $FILE then echo FIle is only accessible by root else echo File does not exist or permissions are incorrect fi |