4 if [ "${tokens[3]}" = "file" ]
6 if [ -f "${tokens[0]}" ]
10 printf "MISSING or REMOVED "
14 elif [ "${tokens[3]}" = "sym_link" ]
16 if [ -L "${tokens[0]}" ]
20 printf "MISSING or REMOVED "
26 if [ "${tokens[3]}" = "file" ]
28 touch /tmp/config-test
29 chmod "${tokens[1]}" /tmp/config-test
30 tmpperms=$(ls -l /tmp/config-test | awk '{print $1}')
31 realperms=$(ls -l "${tokens[0]}" | awk '{print $1}')
33 if [ "$tmpperms" = "$realperms" ]
40 owner=$(ls -l "${tokens[0]}" | awk '{print $3}')
42 if [ "$owner" = "${tokens[4]}" ]
49 group=$(ls -l "${tokens[0]}" | awk '{print $4}')
51 if [ "$group" = "${tokens[5]}" ]
57 elif [ "${tokens[3]}" = "sym_link" ]
59 linkto=$(ls -l "${tokens[0]}" | awk '{print $11}')
60 if [ "${tokens[2]}" = "$linkto" ]
62 printf " the link is correct "
64 printf " the link is WRONG "