mirror of
https://github.com/guezoloic/serverconfig.git
synced 2026-01-25 10:34:23 +00:00
feat: add login notification
This commit is contained in:
@@ -1,24 +1,33 @@
|
|||||||
#!bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
source /usr/local/bin/notifications.sh
|
source /usr/local/bin/libs/common.sh
|
||||||
|
source /etc/serverconfig/.env
|
||||||
|
|
||||||
# initialize_config() {
|
INSTALLED=$1
|
||||||
# local isInstalling="$1"
|
if [[ "--install" == $INSTALLED ]]; then
|
||||||
# local target_file="$2"
|
info_print "\n\
|
||||||
# local crontab_configuration="$3"
|
==================================================\n\
|
||||||
# local link_path="$4"
|
sshd-login Installation\n\
|
||||||
|
--------------------------------------------------"
|
||||||
|
|
||||||
# if [[ $isInstalling != "--install" ]]; then
|
login='session optional pam_exec.so /usr/local/bin/scripts/sshd-login.sh'
|
||||||
# return;
|
file='/etc/pam.d/common-session'
|
||||||
# fi
|
|
||||||
|
|
||||||
# echo "$crontab_configuration $0" | crontab -
|
if [[ ! -f "$file" ]]; then
|
||||||
# }
|
info_print "$file doesn't found." 3
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# install_para="$1"
|
if ! grep -Fxq "$login" "$file"; then
|
||||||
# if [[ $install_para == "--install" ]]; then
|
echo "$login" >> "$file"
|
||||||
|
info_print "login command added to $file." 6
|
||||||
|
else
|
||||||
|
info_print "login command already added to $file." 2
|
||||||
|
fi
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
# fi
|
source /usr/local/bin/libs/notifications.sh
|
||||||
|
|
||||||
case "$PAM_TYPE" in
|
case "$PAM_TYPE" in
|
||||||
open_session)
|
open_session)
|
||||||
|
|||||||
4
scripts/wireguard.sh
Normal file
4
scripts/wireguard.sh
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
INSTALLED=$1
|
||||||
|
if [[ "--install" == $INSTALLED ]]; then exit 0; fi
|
||||||
Reference in New Issue
Block a user