CASA/c_micasad/startup/casacfgpam

26 lines
585 B
Plaintext
Executable File

# Adding CASA pam entries to pam files.
for pam_file in "/etc/pam.d/login" "/etc/pam.d/sshd" "/etc/pam.d/xdm" "/etc/pam.d/gdm" "/etc/pam.d/kdm"
do
if [ -f $pam_file ]
then
MICASA_D=`grep -i pam_micasa $pam_file`
if [ -z "$MICASA_D" ]
then
awk '
/auth/ { authSeen++; }
/account/ {
if (!acctSeen && authSeen)
{
print "auth\trequired\tpam_micasa.so\n";}
acctSeen++;
}
/session/ { sesSeen++; }
// {print $0; }
END { if (sesSeen)
print "session\trequired\tpam_micasa.so\n"; }
' $pam_file > $pam_file.sav
mv $pam_file.sav $pam_file
fi
fi
done