Add option to enable notifications on remote ssh machine

This commit is contained in:
Philipp Dieter 2025-08-13 12:25:26 +02:00
parent b51c934d88
commit 791efc1ca2
2 changed files with 3 additions and 1 deletions

View File

@ -129,6 +129,8 @@ NOTE: This configuration option currently only works for Linux.
:: ::
# Enable notifications on remote machine but do not forward
export AUTO_NOTIFY_ENABLE_SSH=2
# Enable notification forwarding to SSH client # Enable notification forwarding to SSH client
export AUTO_NOTIFY_ENABLE_SSH=1 export AUTO_NOTIFY_ENABLE_SSH=1
# Disable notification forwarding to SSH client # Disable notification forwarding to SSH client

View File

@ -90,7 +90,7 @@ function _auto_notify_message() {
fi fi
# Check if the script is running over SSH # Check if the script is running over SSH
if [[ -n "${SSH_CLIENT}" || -n "${SSH_CONNECTION}" ]]; then if [[ -n "${SSH_CLIENT}" || -n "${SSH_CONNECTION}" ]] && [[ "${AUTO_NOTIFY_ENABLE_SSH-1}" == "1" ]]; then
# Extract the client IP address from environment # Extract the client IP address from environment
local client_ip="${SSH_CLIENT%% *}" local client_ip="${SSH_CLIENT%% *}"
[[ -z "$client_ip" ]] && client_ip="${SSH_CONNECTION%% *}" [[ -z "$client_ip" ]] && client_ip="${SSH_CONNECTION%% *}"