bug fix for pam configuration during ahenk installation

This commit is contained in:
emrekgn 2016-10-25 14:24:53 +03:00
parent 38a09d5856
commit c5110f5488
2 changed files with 4 additions and 24 deletions

21
debian/postinst vendored
View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# postinst script for ahenk
#
# see: dh_installdeb(1)
@ -13,22 +13,10 @@ while true; do
read -p "Eğer makinada var olan bir pam konfigurasyonu varsa geçersiz hale gelecektir.Devam etmek istiyor musunuz? [e/H]" eH
case $eH in
[e] )
if [ -d /etc/pam.d ]
if [ -d /usr/share/pam-configs ]
then
if [ -f /etc/pam.d/common-session ]
then
cp -f /etc/pam.d/common-session /etc/pam.d/common-session.orig
grep -q 'pam_script.so' /etc/pam.d/common-session
if [ $? -eq 0 ]
then
echo "pam_scripst.so zaten mevcut."
else
echo "pam_script.so bulunamadı! /etc/pam.d/common-session dosyasına ekleniyor..."
# Use optional, we don't want access denied if there is a problem:
echo "session optional pam_script.so" >> /etc/pam.d/common-session
echo "pam_script.so eklendi."
fi
fi
echo -e "Name: Support for authentication by external scripts\nDefault: yes\nPriority: 257\nSession-Type: Additional\nSession:\n\toptional\tpam_script.so" > /usr/share/pam-configs/pam_script
DEBIAN_FRONTEND=noninteractive pam-auth-update
fi
break;;
[H] ) exit;;
@ -36,7 +24,6 @@ while true; do
esac
done
systemctl --system daemon-reload
systemctl enable ahenk.service

7
debian/postrm vendored
View file

@ -1,7 +0,0 @@
#!/bin/sh
# postrm script for ahenk
#
if [ -f /etc/pam.d/common-session.orig ]; then
mv -f /etc/pam.d/common-session.orig /etc/pam.d/common-session
fi