Changeset 148 for trunk/tssh
- Timestamp:
- Jan 1, 2018, 6:29:03 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tssh/tssh
r147 r148 186 186 sort -u "/tmp/${base_path}/master++" | split -l ${split_number} - /tmp/${base_path}/__splitted_ 187 187 188 # wait is needed by time tmux session open and ssh time connection 189 tempo=0.8 190 first_tempo=0 191 other_tempo=0 192 if [ -n "${remote_command}" ] 193 then 194 # add tempo after remote command 195 other_tempo=${tempo} 196 first_tempo=$((${tempo} + ${other_tempo})) 197 fi 198 188 199 # loop on each split windows 189 200 for f in $(ls -1 /tmp/${base_path}/ | grep ^__splitted_) … … 200 211 IFS=$'\n' host=($(cat "/tmp/${base_path}/${f}")) 201 212 202 tmux -2 new-session -d -s $session "ssh ${host[0]} ${remote_command} "203 # wait 1sto let new session start...204 sleep 1213 tmux -2 new-session -d -s $session "ssh ${host[0]} ${remote_command}; sleep ${first_tempo}" 214 # wait ${tempo} second to let new session start... 215 sleep ${tempo} 205 216 206 217 for (( i=1 ; i < ${#host[@]} ; i++)) 207 218 do 208 tmux splitw -t $session "ssh ${host[$i]} ${remote_command}" 219 # wait ${tempo} needed in case of ${remote_command} 220 tmux splitw -t $session "ssh ${host[$i]} ${remote_command}; sleep ${other_tempo}" 209 221 tmux select-layout tiled 210 222 done
Note: See TracChangeset
for help on using the changeset viewer.