list="/usr /var /etc /root /boot"
unset ERR

for a in $list ; do
  echo -n "$a - "
  if [ -w $a ] ; then
    ERR=yes 
    echo_ "ERROR: write permissions granted"
  else
    echo_ "checked"
  fi
done 

for a in $(ls -1 /home) ; do
    [ -d /home/$a ] || continue
    echo -n "/home/$a - "
    if [ $(stat -c %U "/home/$a") != "$a" ] ; then
        ERR=yes 
	echo_ "ERROR: wrong owner of dir"
    elif [ $(stat -c %a "/home/$a") -gt 750 ] ; then
	ERR=yes 
	echo_ "ERROR: wrong permmissions of dir"
    else
	echo_ "checked"
    fi
done

[ ! $ERR ] &&  true
