Refactor variable assignments and improve script readability in validate-plex-backups.sh and validate-plex-recovery.sh

- Changed inline variable assignments to separate declaration and assignment for clarity.
- Updated condition checks and log messages for better readability and consistency.
- Added a backup of validate-plex-recovery.sh for safety.
- Introduced a new script run-docker-tests.sh for testing setup in Docker containers.
- Enhanced ssh-login.sh to improve condition checks and logging functionality.
This commit is contained in:
Peter Wood
2025-06-05 17:14:02 -04:00
parent c3f237a321
commit 58b5dea8b4
31 changed files with 5024 additions and 539 deletions

View File

@@ -1,15 +1,15 @@
#!/bin/bash
#
# This script is referenced in `/etc/pam.d/sshd`
# - at the end of the `sshd` file, add
# `session optional pam_exec.so /home/acedanger/shell/ssh-login.sh`
#
# This script is referenced in $(/etc/pam.d/sshd)
# - at the end of the $(sshd) file, add
# $(session optional pam_exec.so /home/acedanger/shell/ssh-login.sh)
#
if [ "${PAM_TYPE}" = "open_session" && "${PAM_RHOST}" -ne "10.0.1.4" ]; then
if [ "${PAM_TYPE}" = "open_session" ] && [ "${PAM_RHOST}" != "10.0.1.4" ]; then
curl \
-H prio:urgent \
-H tags:warning,ssh,login,${HOSTNAME} \
-H tags:warning,ssh,login,"${HOSTNAME}" \
-d "SSH login [${HOSTNAME}] user ${PAM_USER} from ${PAM_RHOST}" \
https://notify.peterwood.rocks/lab
fi