Skip to content

Commit

Permalink
Improved documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
flyingrhinonz committed Apr 25, 2024
1 parent 2b50c11 commit 84553d2
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 3 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,34 @@ nccm menu will reappear. You are allowed to resize your
window outside nccm and the new window size will apply when
nccm menu reappears after you exit from your ssh session.


`nccm_config_preconnect_script`:
Path to an executable that nccm will run prior to making a
connection. Useful if you want to do anything immediately
before making a connection.
It passes the connection string (eg: `user@host`) as `$1`
arg to the script.
Supported values: false (default) or any valid path to
an executable script/program.

Example using this to copy: `kenmode.sh` to the managed
box - set this value similar to:
`nccm_config_preconnect_script: /usr/local/bin/nccm_copy_kenmode.sh`
and then create the target script similar to:

#!/bin/bash

scp /usr/local/lib/kenmode.sh $1:/tmp/
ssh $1 chmod 664 /tmp/kenmode.sh
#rsync --perms --chmod=u+rw,g+rw,o+r /usr/local/lib/kenmode.sh $1:/tmp/
# ^ Works better than the two-command scp/ssh above, but fails when
# rsync not found on the target machine.
# Therefore the first option is more reliable.

Once connected to the target box you can activate kenmode
by sourcing it: `. /tmp/kenmode.sh`


`nccm_config_postconnect_script`:
Same as above but run after the connection exits.
Useful for stuff like tidyups, etc.
Expand Down
26 changes: 23 additions & 3 deletions nccm/nccm
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,34 @@ nccm menu will reappear. You are allowed to resize your
window outside nccm and the new window size will apply when
nccm menu reappears after you exit from your ssh session.
`nccm_config_preconnect_script`:
Path to an executable that nccm will run prior to making a
connection. Useful if you want to do anything immediately
before making a connection.
It passes the connection string (eg: `user@host`) as `$1`
arg to the script.
Supported values: false (default) or any valid path to
an executable script/program.
Example using this to copy: `kenmode.sh` to the managed
box - set this value similar to:
`nccm_config_preconnect_script: /usr/local/bin/nccm_copy_kenmode.sh`
and then create the target script similar to:
#!/bin/bash
scp /usr/local/lib/kenmode.sh $1:/tmp/
ssh $1 chmod 664 /tmp/kenmode.sh
#rsync --perms --chmod=u+rw,g+rw,o+r /usr/local/lib/kenmode.sh $1:/tmp/
# ^ Works better than the two-command scp/ssh above, but fails when
# rsync not found on the target machine.
# Therefore the first option is more reliable.
Once connected to the target box you can activate kenmode
by sourcing it: `. /tmp/kenmode.sh`
`nccm_config_postconnect_script`:
Same as above but run after the connection exits.
Useful for stuff like tidyups, etc.
Expand Down Expand Up @@ -646,7 +667,6 @@ Credits
Big thanks to everyone who reported bugs, submitted feature
requests and improvements that made nccm what it is today.
'''

# Standard library imports:
Expand Down Expand Up @@ -728,8 +748,8 @@ SecureLogging = True


# Program identification strings:
__version__ = '1.7.3'
VersionDate = '2023-12-23'
__version__ = '1.7.4'
VersionDate = '2024-04-26'
ProgramName = 'NCurses ssh Connection Manager'
AuthorName = 'Kenneth Aaron'
AuthorEmail = 'flyingrhino AT orcon DOT net DOT nz'
Expand Down

0 comments on commit 84553d2

Please sign in to comment.