From 25afb824c17f8d066e6a9cbe5651a245dc76a347 Mon Sep 17 00:00:00 2001 From: cemrealpsoy Date: Fri, 17 Jun 2016 18:21:24 +0300 Subject: [PATCH] Ahenk will be login automatically when session opens and also logout automatically when session closes --- debian/ahenk.install | 1 + debian/control | 2 +- debian/postinst | 22 +++++++++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/debian/ahenk.install b/debian/ahenk.install index 99c3db7..4e26f3e 100644 --- a/debian/ahenk.install +++ b/debian/ahenk.install @@ -1,3 +1,4 @@ opt/ / etc/ / lib/ / +usr/ / diff --git a/debian/control b/debian/control index 2fbd7b2..86a8b13 100644 --- a/debian/control +++ b/debian/control @@ -8,5 +8,5 @@ Homepage: http://www.liderahenk.org.tr Package: ahenk Architecture: any -Depends:python3 (>= 3), cython, libidn11, libidn11-dev, slixmpp, python3-dev, python3-pip, libffi-dev, libssl-dev, python3-paramiko, python3-cpuinfo, python3-psutil (>= 4) +Depends:python3 (>= 3), cython, libidn11, libidn11-dev, slixmpp, python3-dev, python3-pip, libffi-dev, libssl-dev, python3-paramiko, python3-cpuinfo, python3-psutil (>= 4), libpam-script Description: Lider Ahenk is an open source project which provides solutions to manage, monitor and audit unlimited number of different systems and users on a network. diff --git a/debian/postinst b/debian/postinst index 2cedb78..9893cf0 100644 --- a/debian/postinst +++ b/debian/postinst @@ -8,7 +8,27 @@ set -e case "$1" in configure) - + +while true; do + read -p "If any 'pam' configuration exists, it will be gone.Do you want to continue?" yn + case $yn in + [Yy]* ) + if [ -d /etc/pam.d ] + then + if [ -f /etc/pam.d/common-session ] + then + + sed -i '/pam_script.so/d' /etc/pam.d/common-session + echo "session required pam_script.so" >> /etc/pam.d/common-session + fi + fi + break;; + [Nn]* ) exit;; + * ) echo "Please answer y(yes) or n(no).";; + esac +done + + systemctl --system daemon-reload systemctl enable ahenk.service