@@ -31,20 +31,20 @@ function print_help {
3131 echo " Runs a Bash command/script over ssh in one or more hosts."
3232 echo " Options:"
3333 echo " "
34+ echo " -g, --globalpw ask one global password for all connections"
3435 echo " -s, --script [file] read commands from a script file instead"
3536 echo " -r, --hostsfile [file] use the list of hosts from a file (one host per line)"
3637 echo " "
37- echo " -g, --globalpw ask one global password for all connections"
3838 echo " -n, --nopw no password (use ssh directly instead of sshpass)"
39- echo " --sshflags [flags] set custom ssh flags"
40- echo " default: '-o ConnectTimeout=5 -o StrictHostKeyChecking=no'"
41- echo " -b, --bashflags [flags] set custom bash flags"
42- echo " default: '-l'"
43- echo " "
44- echo " -l, --log save ssh output (default: ${script_alias} .log) (overwrite)"
45- echo " --logfile [file] save ssh output to a custom file (overwrite)"
39+ echo " -l, --log save ssh output (default: ${script_alias} .log) (append)"
4640 echo " -q, --quiet disable ssh screen output"
4741 echo " "
42+ echo " --bashflags [flags] set custom bash flags"
43+ echo " default: '-l'"
44+ echo " --sshflags [flags] set custom ssh flags"
45+ echo " default: '-o ConnectTimeout=5 -o StrictHostKeyChecking=no'"
46+ echo " --logfile [file] save ssh output to a custom file (append)"
47+ echo " "
4848 echo " Examples:"
4949 echo " "
5050 echo " runoverssh root 'systemctl restart apache2' server1 server2"
@@ -72,7 +72,7 @@ global_pw="" # -g, --globalpw
7272passwords=()
7373no_pw=" "
7474ssh_flags=" -o ConnectTimeout=5 -o StrictHostKeyChecking=no" # --sshflags
75- bash_flags=" -l" # -b, --bashflags
75+ bash_flags=" -l" # --bashflags
7676quiet_enabled=" " # -q | --quiet
7777
7878if [[ " $1 " == " --help" ]]; then
@@ -109,7 +109,7 @@ for parameter do
109109 " --sshflags" )
110110 ssh_flags=" ${parameter} "
111111 ;;
112- " -b " | " - -bashflags" )
112+ " --bashflags" )
113113 bash_flags=" ${parameter} "
114114 ;;
115115 esac
@@ -118,7 +118,7 @@ for parameter do
118118 else # first or not waiting option
119119 is_first=" no"
120120 case " ${parameter} " in
121- " -s" | " --script" | " -r" | " --hostsfile" | " --logfile" | " --sshflags" | " -b " | " - -bashflags" )
121+ " -s" | " --script" | " -r" | " --hostsfile" | " --logfile" | " --sshflags" | " --bashflags" )
122122 waiting_option=" ${parameter} "
123123 ;;
124124 " -g" | " --globalpw" )
0 commit comments