Changeset 419


Ignore:
Timestamp:
Nov 25, 2019, 9:21:20 AM (4 years ago)
Author:
g7moreau
Message:
  • Change config file path. Small help
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tssh/tssh

    r418 r419  
    1111export LANG=C
    1212
     13VERSION='0.2.0'
    1314
    1415function usage() {
    1516   cat <<END_USAGE
    16 NAME
    17    $(basename $0) - tmux cluster ssh
    18 
    19 SYNOPSIS
    20    $0 [-w number] [-f] [-v] [-c remote_cmd] [-o ssh_option] <host1> <host2> <clusterssh class>... <hostM>- <hostN>+
    21 
    22 OPTIONS
     17tssh - tmux cluster ssh
     18
     19 tssh [-w number] [-f] [-v] [-p] [-c remote_cmd] [-o ssh_option] <host1> <host2> <clusterssh class>... <hostM>- <hostN>+
     20
    2321   -w windows     windows to open (integer, default 16)
    2422   -o ssh_option  option to pass to ssh
     
    2927   -h             help
    3028
    31 DESCRIPTION
    32    tssh can be use to launch terminal on many computer in parallel with tmux
    33    multiplexer and ssh.
    34    The tmux windows is splitted automatically.
    35    If you need more computers on the same windows, you can zoom in and out
    36    under gnome terminal with Ctrl- or Ctrl+.
    37    This must be done before launching tssh.
    38    
    39    On the command line, you can put host, login@host, clusterssh class.
    40    A host or a class can be remove from the list with a dash append
    41    and force to be in this one with a plus append.
    42    Example with the cluster ssh config below:
    43    
    44     tssh all team- node005 laptop04+
    45 
    46    Is equivalent to:
    47  
    48     tssh srv-mail srv-dns srv-imap srv-web srv-proxy \\
    49       node001 node002 node003 node004 \\
    50       node101 node102 node103 node104 \\
    51       node005 laptop04
    52 
    53    The control command for tmux is Ctrl^b.
    54    You can switch from broadcast to a local machine with Ctrl^b Ctrl^b
    55    and move between machine with Ctrl^b ArrowKey.
    56 
    57 DEPENDS
    58    On Debian, you need the package
    59 
    60     apt-get install tmux ncurses-bin wamerican nmap
    61 
    62    wamerican (or wfrench...) is used to choose a random word in the file /usr/share/dict/words
    63    for each new tmux session.
    64 
    65    ncurses-bin is required for the tput command
    66    to automatically split your terminal into several small panels.
    67    nmap is only used for dynamic DNS domain and dynamic scan.
    68    This is not mandatory for general use.
    69 
    70    By default, tssh use tput to know the number of columns and lines of your terminal.
    71    It takes 10 lines and 40 columns for each windows by default.
    72    If tput is not installed, the default is 16 windows...
    73 
    74 CONFIGURATION
    75    The clusterssh config file ~/.csshrc is a key values file.
    76    The "clusters" is mandatory for clusterssh (not tssh) and define the other keys.
    77    Values could be computer list or other key...
    78    
    79     clusters = all server s1 s2 s3 node n1 n2 team switch
    80     all = server node team
    81     server = s1 s2
    82     node = n1 n2
    83     s1 = srv-mail srv-dns srv-imap
    84     s2 = srv-web srv-proxy
    85     n1 = node001 node002 node003 node004
    86     n2 = node101 node102 node103 node104
    87     team = pc01 pc06 laptop04 laptop05 laptop09
    88     switch = root@switch01 root@switch05 root@switch17
    89 
    90    The tssh config file (~/.tsshrc) can be use change the default parameters.
    91    
    92     #export split_number=16
    93     export dyn_domain='mycompagny.local'
    94     #export ssh_option=''
    95     #export fast='yes'
    96     #export verbose='yes'
    97 
    98 AUTHOR
    99    Gabriel Moreau
    100 
    101 COPYRIGHT
    102    Copyright (C) 2014-2019, LEGI UMR 5519 / CNRS UGA G-INP, Grenoble, France
    103    Licence : GNU GPL version 2 or later
     29VERSION ${VERSION}
    10430END_USAGE
    10531   }
     
    11440
    11541export dyn_domain=''
    116 if [ -e "${HOME}/.tsshrc" ]
     42if [ -e "${HOME}/.config/tssh/config.sh" ]
     43then
     44   . "${HOME}/.config/tssh/config.sh"
     45elif [ -e "${HOME}/.tsshrc" ]
    11746then
    11847   . "${HOME}/.tsshrc"
     
    374303=item C<-p>             launch in parallel (only with option C<-c>) with command parallel or xargs
    375304
    376 =item  C<-h>             help
     305=item C<-h>             help
    377306
    378307=back
Note: See TracChangeset for help on using the changeset viewer.