syntax error near unexpected token `else' pam_tally2.so

Hello I tried to run this script but I still have error and no ideas. Description of script. I treid many things but didnt works. Please help

Description what the script should do i paste below.

File permissions must be set for all systems not using pam_tally2.so: • rw- --- --- (or more restrictive)

/var/log/faillog

#!/bin/sh 

module_id="Axxxx"
echo " === $module_id module === "

#MODULE BODY

os=`uname`
path=`/var/log/faillog`
perm_path=`ls -l /var/log/faillog | cut -c 2-10`

if [ "$os" == "Linux" ]
then 

output=`ldd /bin/su | grep "libpam.so.0" | awk -F  " " '{print $1}'`

if [ "$output" == "libpam.so.0" ]
then
    compliant="Yes"
    actual_value="pam is using"
else

    if [ -f "$path"  ] then
        if [ "$perm_path" == "rw-------" ] then
        compliant="Yes"
        actual_value="perm $perm_path"
        else
            if [ "$perm_path" == "r--------" ] then
            compliant="Yes"
            actual_value="perm $perm_path"
            else
                if [ "$perm_path" == "---------" ] then
                    compliant="Yes"
                    actual_value="perm $perm_path"
                    else 
                    compliant="No"
                    actual_value="wrong perm $perm_path"
                fi
            fi
        fi
    fi
fi                            



else
compliant="N/A"
actual_value="AIX host"
fi


# SCRIPT RESULT
echo :::$module_id:::$compliant:::$actual_value:::
echo " === End of $module_id module === "

I got errors:

 line 9: /var/log/faillog: cannot execute binary file
./Axxxx.sh: line 27: syntax error near unexpected token `else'
./Axxxx.sh: line 27: `        else'