mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-11-23 10:12:18 +03:00
pam_script_ses files changes
This commit is contained in:
parent
1f96586b8c
commit
6963448efe
2 changed files with 11 additions and 11 deletions
|
@ -14,14 +14,14 @@ function log() {
|
||||||
echo "$(date) $0: $@" >> $LOG
|
echo "$(date) $0: $@" >> $LOG
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -n $PAM_USER ] && [ $PAM_USER != "root" ]; then
|
if [[ -n $PAM_USER ]] && [[ $PAM_USER != "root" ]]; then
|
||||||
if ([ -n $PAM_SERVICE ] && [[ ( $PAM_SERVICE == *"dm" || $PAM_SERVICE == "gdm"* )]]) || ([ -n $PAM_TTY ] && [[ $PAM_TTY == ":"* ]]); then
|
if ([[ -n $PAM_SERVICE ]] && [[ ( $PAM_SERVICE == *"dm" || $PAM_SERVICE == "gdm"* )]]) || ([[ -n $PAM_TTY ]] && [[ $PAM_TTY == ":"* ]]); then
|
||||||
SERVICE="none"
|
SERVICE="none"
|
||||||
if [ -n $PAM_SERVICE ]; then
|
if [[ -n $PAM_SERVICE ]]; then
|
||||||
SERVICE="$PAM_SERVICE"
|
SERVICE="$PAM_SERVICE"
|
||||||
fi
|
fi
|
||||||
TTY_DISPLAY="none"
|
TTY_DISPLAY="none"
|
||||||
if [ -n $PAM_TTY ]; then
|
if [[ -n $PAM_TTY ]]; then
|
||||||
TTY_DISPLAY="$PAM_TTY"
|
TTY_DISPLAY="$PAM_TTY"
|
||||||
fi
|
fi
|
||||||
if [[ $PAM_USER = *'\'* ]]; then
|
if [[ $PAM_USER = *'\'* ]]; then
|
||||||
|
@ -32,6 +32,6 @@ if [ -n $PAM_USER ] && [ $PAM_USER != "root" ]; then
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
log "logout: $PAM_USER service: $SERVICE tty: $TTY_DISPLAY"
|
log "logout: $PAM_USER service: $SERVICE tty: $TTY_DISPLAY"
|
||||||
sudo python3 /usr/share/ahenk/ahenkd.py logout $PAM_USER
|
python3 /usr/share/ahenk/ahenkd.py logout $PAM_USER
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -14,14 +14,14 @@ function log() {
|
||||||
echo "$(date) $0: $@" >> $LOG
|
echo "$(date) $0: $@" >> $LOG
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -n $PAM_USER ] && [ $PAM_USER != "root" ]; then
|
if [[ -n $PAM_USER ]] && [[ $PAM_USER != "root" ]]; then
|
||||||
if ([ -n $PAM_SERVICE ] && [[ ( $PAM_SERVICE == "gdm"* || $PAM_SERVICE == *"dm" )]]) || ([ -n $PAM_TTY ] && [[ $PAM_TTY == ":"* ]]); then
|
if ([[ -n $PAM_SERVICE ]] && [[ ( $PAM_SERVICE == "gdm"* || $PAM_SERVICE == *"dm" )]]) || ([[ -n $PAM_TTY ]] && [[ $PAM_TTY == ":"* ]]); then
|
||||||
SERVICE="none"
|
SERVICE="none"
|
||||||
if [ -n $PAM_SERVICE ]; then
|
if [[ -n $PAM_SERVICE ]]; then
|
||||||
SERVICE="$PAM_SERVICE"
|
SERVICE="$PAM_SERVICE"
|
||||||
fi
|
fi
|
||||||
TTY_DISPLAY="none"
|
TTY_DISPLAY="none"
|
||||||
if [ -n $PAM_TTY ]; then
|
if [[ -n $PAM_TTY ]]; then
|
||||||
TTY_DISPLAY="$PAM_TTY"
|
TTY_DISPLAY="$PAM_TTY"
|
||||||
fi
|
fi
|
||||||
domain="none"
|
domain="none"
|
||||||
|
@ -35,10 +35,10 @@ if [ -n $PAM_USER ] && [ $PAM_USER != "root" ]; then
|
||||||
fi
|
fi
|
||||||
if [[ $domain != "none" ]]; then
|
if [[ $domain != "none" ]]; then
|
||||||
log "login: $PAM_USER service: $SERVICE tty: $TTY_DISPLAY domain: $domain"
|
log "login: $PAM_USER service: $SERVICE tty: $TTY_DISPLAY domain: $domain"
|
||||||
sudo python3 /usr/share/ahenk/ahenkd.py login $PAM_USER $SERVICE $TTY_DISPLAY $domain
|
python3 /usr/share/ahenk/ahenkd.py login $PAM_USER $SERVICE $TTY_DISPLAY $domain
|
||||||
else
|
else
|
||||||
log "login: $PAM_USER service: $SERVICE tty: $TTY_DISPLAY domain: none"
|
log "login: $PAM_USER service: $SERVICE tty: $TTY_DISPLAY domain: none"
|
||||||
sudo python3 /usr/share/ahenk/ahenkd.py login $PAM_USER $SERVICE $TTY_DISPLAY
|
python3 /usr/share/ahenk/ahenkd.py login $PAM_USER $SERVICE $TTY_DISPLAY
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue