pec2 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pec2/cli.rb +5 -2
- data/lib/pec2/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d212e880ee55a9fd7282d28c16d77b9435019b3
|
4
|
+
data.tar.gz: 582aa6fd904cc9a75ec0d6a2063706ceada859d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba417870100d95967e9df7dcbcd501bb7e15e81905554295d1a2acaa1ff732a45424c69903cb1f19510009dd66ff56812943db26526e99821664829639ba7053
|
7
|
+
data.tar.gz: 7cc2a92acc8c92ab9b96235e32765bb86e8e89928b2abef6ae554d549425c36db6e4ef33101d707698e597da0feeb3e575ddf63e99c1a90a64ddf44df0de6ad9
|
data/lib/pec2/cli.rb
CHANGED
@@ -17,6 +17,7 @@ module Pec2
|
|
17
17
|
|
18
18
|
desc 'run_command', 'run command'
|
19
19
|
option :command, aliases: '-c', type: :string, desc: 'command'
|
20
|
+
option :file, aliases: '-f', type: :string, desc: 'script file'
|
20
21
|
option :sudo_password, aliases: '-s', type: :string, desc: 'sudo_password'
|
21
22
|
option :tag, aliases: '-t', type: :hash, default: {}, desc: 'tag'
|
22
23
|
option :user, aliases: '-u', type: :string, desc: 'user'
|
@@ -44,7 +45,9 @@ module Pec2
|
|
44
45
|
|
45
46
|
pssh = Pssh.new(options, addresses, addresses.size)
|
46
47
|
|
47
|
-
|
48
|
+
file_command = options[:file] ? File.read(options[:file]) : nil
|
49
|
+
command = options[:command] || file_command
|
50
|
+
interactive = command ? false : true
|
48
51
|
|
49
52
|
if interactive
|
50
53
|
while true
|
@@ -52,7 +55,7 @@ module Pec2
|
|
52
55
|
pssh.exec_pssh_command(command)
|
53
56
|
end
|
54
57
|
else
|
55
|
-
ret = pssh.exec_pssh_command(
|
58
|
+
ret = pssh.exec_pssh_command(command)
|
56
59
|
unless ret
|
57
60
|
exit 1
|
58
61
|
end
|
data/lib/pec2/version.rb
CHANGED