Changeset 425 for trunk/tssh
- Timestamp:
- Nov 25, 2019, 11:30:33 AM (5 years ago)
- Location:
- trunk/tssh
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tssh/config.sample.sh
r420 r425 1 1 # config file ~/.config/tssh/config.sh 2 2 3 #export delay_time=0.8 3 4 #export split_number=16 4 5 export dyn_domain='mycompagny.local' -
trunk/tssh/tssh
r424 r425 11 11 export LANG=C 12 12 13 VERSION='0.2. 1'13 VERSION='0.2.2' 14 14 15 15 function usage() { … … 17 17 tssh - tmux cluster ssh 18 18 19 tssh [-w number] [-f] [-v] [- p] [-c remote_cmd] [-o ssh_option] <host1> <host2> <clusterssh class>... <hostM>- <hostN>+19 tssh [-w number] [-f] [-v] [-h] [-p] [-c remote_cmd] [-o ssh_option] <host1> <host2> <clusterssh class>... <hostM>- <hostN>+ 20 20 21 21 -w windows windows to open (integer, default 16) … … 31 31 } 32 32 33 export delay_time=0.8 33 34 export remote_command='' 34 35 export ssh_option='' … … 199 200 200 201 # wait is needed by time tmux session open and ssh time connection 201 tempo=0.8 202 first_tempo=0 203 other_tempo=0 202 first_delay_time=0 203 other_delay_time=0 204 204 if [ -n "${remote_command}" ] 205 205 then 206 # add tempoafter remote command207 other_ tempo=${tempo}208 first_ tempo="${tempo} ${other_tempo}"206 # add delay time after remote command 207 other_delay_time=${delay_time} 208 first_delay_time="${delay_time} ${other_delay_time}" 209 209 fi 210 210 … … 223 223 IFS=$'\n' host=($(cat "/tmp/${base_path}/${f}")) 224 224 225 tmux -2 new-session -d -s $session "ssh ${ssh_option} ${host[0]} ${remote_command}; sleep ${first_ tempo}"226 # wait ${ tempo} second to let new session start...227 sleep ${ tempo}225 tmux -2 new-session -d -s $session "ssh ${ssh_option} ${host[0]} ${remote_command}; sleep ${first_delay_time}" 226 # wait ${delay_time} second to let new session start... 227 sleep ${delay_time} 228 228 229 229 for (( i=1 ; i < ${#host[@]} ; i++)) 230 230 do 231 # wait ${ tempo} needed in case of ${remote_command}232 tmux splitw -t $session "ssh ${ssh_option} ${host[$i]} ${remote_command}; sleep ${other_ tempo}"231 # wait ${delay_time} needed in case of ${remote_command} 232 tmux splitw -t $session "ssh ${ssh_option} ${host[$i]} ${remote_command}; sleep ${other_delay_time}" 233 233 tmux select-layout tiled 234 234 done … … 285 285 =head1 SYNOPSIS 286 286 287 tssh [-w number] [-f] [-v] [- p] [-c remote_cmd] [-o ssh_option] <host1> <host2> <clusterssh class>... <hostM>- <hostN>+287 tssh [-w number] [-f] [-v] [-h] [-p] [-c remote_cmd] [-o ssh_option] <host1> <host2> <clusterssh class>... <hostM>- <hostN>+ 288 288 289 289 =head1 OPTIONS … … 371 371 The C<tssh> config file (F<~/.config/tssh/config.sh>) can be use change the default parameters. 372 372 373 #export delay_time=0.8 373 374 #export split_number=16 374 375 export dyn_domain='mycompagny.local' … … 377 378 #export verbose='yes' 378 379 380 =head2 C<delay_time> 381 382 When use with C<tmux>, add a small delay before lauching the second shell to let C<tmux> open the window. 383 384 379 385 =head1 SEE ALSO 380 386 381 387 cluster-ssh, cssh, xargs, parallel, tmux 382 388 389 383 390 =head1 AUTHORS 384 391 385 392 Written by Gabriel Moreau, Grenoble - France 393 386 394 387 395 =head1 COPYRIGHT
Note: See TracChangeset
for help on using the changeset viewer.