mirror of
https://github.com/philippdieter/zsh-auto-notify.git
synced 2025-10-13 03:58:44 +00:00
Add option to enable notifications on remote ssh machine
This commit is contained in:
parent
b51c934d88
commit
791efc1ca2
@ -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
|
||||||
|
@ -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%% *}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user