diff --git a/README.rst b/README.rst index b955a5d..2312678 100644 --- a/README.rst +++ b/README.rst @@ -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 export AUTO_NOTIFY_ENABLE_SSH=1 # Disable notification forwarding to SSH client diff --git a/auto-notify.plugin.zsh b/auto-notify.plugin.zsh index ce3c90d..cef0517 100644 --- a/auto-notify.plugin.zsh +++ b/auto-notify.plugin.zsh @@ -90,7 +90,7 @@ function _auto_notify_message() { fi # 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 local client_ip="${SSH_CLIENT%% *}" [[ -z "$client_ip" ]] && client_ip="${SSH_CONNECTION%% *}"