psadmin_plus 2.0.0 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +5 -5
  2. data/bin/psa +3 -1
  3. data/lib/psadmin_plus.rb +22 -7
  4. metadata +3 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3e4f004072143dcceec33f19bf0c955ca802def3
4
- data.tar.gz: d4c444e6f95614d2af04aae2eacf3ea615e707a6
2
+ SHA256:
3
+ metadata.gz: f9e50fadeb47fc6959bfef534bb1fb031c85dc7051291ccbf914df38731351e6
4
+ data.tar.gz: 54aefd4d1ed463119baf1450a9feec43dc46db9e11c83843d4d790b536ac7278
5
5
  SHA512:
6
- metadata.gz: 81fd49adf9bc1f06ec09fe36bc6b5ffb27d307175f82695894800a257bb854faf8a9e7ff2d062b00c7c28e5473212d4e691de53c533cf026cd9dae76323ad86b
7
- data.tar.gz: 338c75a0a247a97ac5b360f853410c32ca356afbe6c08a61b1835ab3d986f043c21f2d39108b5e338fe89d4d130b3b925462517d03de607e2daf7856ee2f0c7a
6
+ metadata.gz: a8255d51419c37a7cd16696202434131f4861d5a1f647dfc1558268801942cc72689e5ed6f4f492c10e64c941e732e42cc38c2af9c758d39b0dcf8e6194e5a45
7
+ data.tar.gz: 76cd40f2fb74de8824add86573a2766feed4f269039b9095e176fc4e71c8a5182a7bc2d885c05b5cd1d1deb8fbcdd7c44fbce7f2444b4c9d4519e2b8886bafee
data/bin/psa CHANGED
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'psadmin_plus'
4
- #require_relative '../lib/psadmin_plus.rb'
5
4
 
6
5
  # options
7
6
  opts_c = ARGV.shift || "help"
@@ -99,6 +98,9 @@ commands.each do |c|
99
98
  when "configure"
100
99
  do_cmd_banner(c,t,d)
101
100
  do_configure(t,d)
101
+ when "reconfigure"
102
+ do_cmd_banner(c,t,d)
103
+ do_reconfigure(t,d)
102
104
  when "purge"
103
105
  do_cmd_banner(c,t,d)
104
106
  do_purge(t,d)
@@ -18,6 +18,7 @@ def do_help
18
18
  puts " stop poolrm, if enabled, stop the domain"
19
19
  puts " restart stop and start the domain"
20
20
  puts " purge clear domain cache"
21
+ puts " reconfigure stop, configure, and start the domain"
21
22
  puts " bounce stop, flush, purge, configure and start the domain"
22
23
  puts " kill force stop the domain"
23
24
  puts " configure configure the domain"
@@ -97,6 +98,7 @@ def do_cmd(cmd, print = true, powershell = true)
97
98
  out = "Invalid OS"
98
99
  end
99
100
  print ? (puts out) : result = out
101
+ out
100
102
  end
101
103
 
102
104
  def do_cmd_banner(c,t,d)
@@ -267,13 +269,15 @@ def do_start(type, domain)
267
269
  start_app_service_cmd = "start-service #{app_service_name}"
268
270
  start_prcs_cmd = "#{PS_PSADMIN_PATH}/psadmin -p start -d #{domain}"
269
271
  start_prcs_service_cmd = "start-service #{prcs_service_name}"
270
- start_web_cmd = "#{PS_PSADMIN_PATH}/psadmin -w start -d #{domain}"
272
+ start_web_cmd_lnx = "${PS_CFG_HOME?}/webserv/#{domain}/bin/startPIA.sh"
273
+ start_web_cmd_win = "#{PS_PSADMIN_PATH}/psadmin -w start -d #{domain}"
271
274
  start_web_service_cmd = "start-service #{web_service_name}"
272
275
 
276
+ # 10-08-2020 Dale Haman: Changing the logic used on PS_WIN_SERVICES, it will never be tux, app or all.
273
277
  case type
274
278
  when "app"
275
279
  case "#{PS_WIN_SERVICES}"
276
- when "tux", "app", "all"
280
+ when "true", "tux", "app", "all"
277
281
  do_cmd(start_app_service_cmd)
278
282
  else
279
283
  do_cmd(start_app_cmd)
@@ -284,7 +288,7 @@ def do_start(type, domain)
284
288
  end
285
289
  when "prcs"
286
290
  case "#{PS_WIN_SERVICES}"
287
- when "tux", "prcs", "all"
291
+ when "true", "tux", "prcs", "all"
288
292
  do_cmd(start_prcs_service_cmd)
289
293
  else
290
294
  do_cmd(start_prcs_cmd)
@@ -296,16 +300,21 @@ def do_start(type, domain)
296
300
  when "web"
297
301
  case "#{OS_CONST}"
298
302
  when "linux"
299
- do_cmd(start_web_cmd)
303
+ if File.exist?("#{ENV['PS_CFG_HOME']}/webserv/#{domain}/servers/PIA/tmp/PIA.lok")
304
+ puts "Domain #{domain} already started"
305
+ else
306
+ do_cmd(start_web_cmd_lnx)
307
+ sleep 5.0
308
+ end
300
309
  when "windows"
301
310
  case "#{PS_WIN_SERVICES}"
302
- when "web", "all"
311
+ when "true", "web", "all"
303
312
  do_cmd(start_web_service_cmd)
304
313
  else
305
314
  # Run command outside of powershell with 'false' parameter
306
- do_cmd(start_web_cmd, true, false)
315
+ do_cmd(start_web_cmd_win, true, false)
307
316
  case "#{PS_TRAIL_SERVICE}"
308
- when "true"
317
+ when "true", "web", "all"
309
318
  do_cmd(start_web_service_cmd)
310
319
  end
311
320
  end
@@ -462,6 +471,12 @@ def do_restart(type, domain)
462
471
  do_start(type, domain)
463
472
  end
464
473
 
474
+ def do_reconfigure(type, domain)
475
+ do_stop(type, domain)
476
+ do_configure(type, domain)
477
+ do_start(type, domain)
478
+ end
479
+
465
480
  def do_bounce(type, domain)
466
481
  do_stop(type, domain)
467
482
  do_purge(type, domain)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: psadmin_plus
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Benson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-08-29 00:00:00.000000000 Z
12
+ date: 2021-01-04 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A psadmin helper tool
15
15
  email: kyle@psadmin.io
@@ -39,8 +39,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  requirements: []
42
- rubyforge_project:
43
- rubygems_version: 2.6.12
42
+ rubygems_version: 3.1.4
44
43
  signing_key:
45
44
  specification_version: 4
46
45
  summary: psadmin plus