feat: add login notification

This commit is contained in:
2025-07-30 21:33:12 +02:00
parent f28809fba3
commit 66d026a212
2 changed files with 28 additions and 15 deletions

View File

@@ -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
View File

@@ -0,0 +1,4 @@
#!/bin/bash
INSTALLED=$1
if [[ "--install" == $INSTALLED ]]; then exit 0; fi