Changeset 428


Ignore:
Timestamp:
Nov 25, 2019, 1:52:13 PM (4 years ago)
Author:
g7moreau
Message:
  • Add option -d
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tssh/tssh

    r427 r428  
    66
    77# Clean when Ctrl^C
    8 trap '[ -n "${base_path}" -a -d "/tmp/${base_path}" ] && rm -rf "/tmp/${base_path}"; exit 4;' QUIT INT TERM
     8trap '[ -n "${base_path}" -a -d "/tmp/${base_path}" ] && rm -rf "/tmp/${base_path}"; exit 2;' QUIT INT TERM
    99
    1010export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
    1111export LANG=C
    1212
    13 VERSION='0.2.4'
     13VERSION='0.3.1'
    1414
    1515function usage() {
     
    1717tssh - tmux cluster ssh
    1818
    19  tssh [-w number] [-f] [-v] [-h] [-p] [-c remote_cmd] [-o ssh_option] <host1> <host2> <clusterssh class>... <hostM>- <hostN>+
     19 tssh [-w number] [-f] [-v] [-h] [-p] [-d delay_time] [-c remote_cmd] [-o ssh_option] <host1> <host2> <clusterssh class>... <hostM>- <hostN>+
    2020
    2121   -w windows     windows to open (integer, default 16)
     
    2323   -f             fast, no nmap scan to eliminate sleeping computer
    2424   -v             verbose
     25   -d delay_time  delay between parallel connexion to remote host
    2526   -c remote_cmd  launch the remote command on hosts and exit
    2627   -p             launch in parallel (only with -c) with command parallel or xargs
     
    5152# get options
    5253if [ $# -eq 0 ]; then usage; exit 1; fi
    53 while getopts "w:o:c:fvph" options
     54while getopts "w:o:d:c:fvph" options
    5455do
    5556   case ${options} in
     
    6061         else
    6162            usage
    62             exit 2
     63            exit 4
    6364         fi
     65         ;;
     66      d)
     67         if echo ${OPTARG} | egrep -q '^[[:digit:]]+$' && [ ${OPTARG} -gt 0 ]
     68         then
     69            export delay_time=${OPTARG}
     70         else
     71            usage
     72            exit 5
     73         fi         
    6474         ;;
    6575      c)
     
    6979         else
    7080            usage
    71             exit 2
     81            exit 6
    7282         fi         
    7383         ;;
     
    8191         else
    8292            usage
    83             exit 2
     93            exit 7
    8494         fi
    8595         ;;
     
    285295=head1 SYNOPSIS
    286296
    287  tssh [-w number] [-f] [-v] [-h] [-p] [-c remote_cmd] [-o ssh_option] <host1> <host2> <clusterssh class>... <hostM>- <hostN>+
     297 tssh [-w number] [-f] [-v] [-h] [-p] [-d delay_time] [-c remote_cmd] [-o ssh_option] <host1> <host2> <clusterssh class>... <hostM>- <hostN>+
    288298
    289299=head1 OPTIONS
     
    300310
    301311Fast, no nmap scan to eliminate sleeping computer
     312
     313=head2 C<-d delay_time>
     314
     315When use C<tmux> context,
     316add a small delay in second before lauching the second shell
     317to let C<tmux> the time to open the window (default 0.8).
    302318
    303319=head2 C<-c remote_cmd>
     
    392408=head2 C<delay_time>
    393409
    394 When use with C<tmux>,
    395 add a small delay before lauching the second shell to let C<tmux> open the window (default 0.8)
     410See option C<-d>.
    396411
    397412=head2 C<split_number>
Note: See TracChangeset for help on using the changeset viewer.