Skip to content

Commit 15c3e71

Browse files
committed
help/readme improved
1 parent 3390fb8 commit 15c3e71

2 files changed

Lines changed: 23 additions & 23 deletions

File tree

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ $ runoverssh [OPTIONS] USERNAME COMMAND HOSTS...
1717

1818
#### Options:
1919
```
20-
-s, --script [file] read commands from a script file instead
21-
-r, --hostsfile [file] use the list of hosts from a file (one host per line)
20+
-g, --globalpw ask one global password for all connections
21+
-s, --script [file] read commands from a script file instead
22+
-r, --hostsfile [file] use the list of hosts from a file (one host per line)
2223
23-
-g, --globalpw ask one global password for all connections
24-
-n, --nopw no password (use ssh directly instead of sshpass)
25-
--sshflags [flags] set custom ssh flags
26-
default: '-o ConnectTimeout=5 -o StrictHostKeyChecking=no'
27-
-b, --bashflags [flags] set custom bash flags
28-
default: '-l'
29-
30-
-l, --log save ssh output (default: runoverssh.log) (overwrite)
31-
--logfile [file] save ssh output to a custom file (overwrite)
32-
-q, --quiet disable ssh screen output
24+
-n, --nopw no password (use ssh directly instead of sshpass)
25+
-l, --log save ssh output (default: ${script_alias}.log) (append)
26+
-q, --quiet disable ssh screen output
3327
28+
--bashflags [flags] set custom bash flags
29+
default: '-l'
30+
--sshflags [flags] set custom ssh flags
31+
default: '-o ConnectTimeout=5 -o StrictHostKeyChecking=no'
32+
--logfile [file] save ssh output to a custom file (append)
33+
3434
```
3535

3636
#### Examples

runoverssh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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
7272
passwords=()
7373
no_pw=""
7474
ssh_flags="-o ConnectTimeout=5 -o StrictHostKeyChecking=no" # --sshflags
75-
bash_flags="-l" #-b, --bashflags
75+
bash_flags="-l" # --bashflags
7676
quiet_enabled="" # -q | --quiet
7777

7878
if [[ "$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

Comments
 (0)