Changeset 390


Ignore:
Timestamp:
Jun 13, 2019, 11:42:52 AM (5 years ago)
Author:
g7moreau
Message:
  • Add -o option
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tssh/tssh

    r197 r390  
    1818
    1919SYNOPSIS
    20    $0 [-w number] [-f] [-v] [-c remote_cmd] <host1> <host2> <clusterssh class>... <hostM>- <hostN>+
     20   $0 [-w number] [-f] [-v] [-c remote_cmd] [-o ssh_option] <host1> <host2> <clusterssh class>... <hostM>- <hostN>+
    2121
    2222OPTIONS
    2323   -w             windows to open (integer, default 16)
     24   -o             option to pass to ssh
    2425   -f             fast, no nmap scan to eliminate sleeping computer
    2526   -v             verbose
     
    9798
    9899COPYRIGHT
    99    Copyright (C) 2014-2018, LEGI UMR 5519 / CNRS UGA G-INP, Grenoble, France
     100   Copyright (C) 2014-2019, LEGI UMR 5519 / CNRS UGA G-INP, Grenoble, France
    100101   Licence : GNU GPL version 2 or later
    101102END_USAGE
     
    103104
    104105export remote_command=''
     106export ssh_option=''
    105107export split_number=16
    106108if which tput > /dev/null
     
    133135         then
    134136            export remote_command=${OPTARG}
     137         else
     138            usage
     139            exit 2
     140         fi
     141         ;;
     142      o)
     143         if echo ${OPTARG} | egrep -q '[[:alpha:][:digit:]]'
     144         then
     145            export ssh_option=${OPTARG}
    135146         else
    136147            usage
     
    262273   IFS=$'\n' host=($(cat "/tmp/${base_path}/${f}"))
    263274
    264    tmux -2 new-session -d -s $session "ssh ${host[0]} ${remote_command}; sleep ${first_tempo}"
     275   tmux -2 new-session -d -s $session "ssh ${ssh_option} ${host[0]} ${remote_command}; sleep ${first_tempo}"
    265276   # wait ${tempo} second to let new session start...
    266277   sleep ${tempo}
     
    269280   do
    270281      # wait ${tempo} needed in case of ${remote_command}
    271       tmux splitw -t $session "ssh ${host[$i]} ${remote_command}; sleep ${other_tempo}"
     282      tmux splitw -t $session "ssh ${ssh_option}${host[$i]} ${remote_command}; sleep ${other_tempo}"
    272283      tmux select-layout tiled
    273284   done
Note: See TracChangeset for help on using the changeset viewer.