methods/ai_common.rb
# Check the publisher port isn't being used
Check the publisher port isn't being used
Check the publisher port isn ' t being used
def check_ai_publisherport(options)
  message = "Information:\tDetermining if publisher port "+options['publisherport']+" is in use"
  command = "svcprop -a pkg/server |grep \"port count\" |grep -v #{options['service']}"
  in_use  = execute_command(options,message,command)
  if in_use.match(/#{options['publisherport']}/)
    if options['verbose'] == true
      handle_output(options,"Warning:\tPublisher port #{options['publisherport']} is in use")
      handle_output(options,"Information:\tFinding free publisher port")
    end
  end
  while in_use.match(/#{options['publisherport']}/)
    options['publisherport'] = options['publisherport'].to_i+1
    options['publisherport'] = options['publisherport'].to_s
  end
  if options['verbose'] == true
    handle_output(options,"Information: Setting publisher port to #{options['publisherport']}")
  end
  return options
end
def check_ai_publisherport ( options ) message = "Information:\tDetermining if publisher port " + options [ 'publisherport' ] + " is in use" command = "svcprop -a pkg/server |grep \"port count\" |grep -v #{options['service']}" in_use = execute_command ( options , message , command ) if in_use . match ( / #{ options [ 'publisherport' ] } / ) if options [ 'verbose' ] == true handle_output ( options , "Warning:\tPublisher port #{options['publisherport']} is in use" ) handle_output ( options , "Information:\tFinding free publisher port" ) end end while in_use . match ( / #{ options [ 'publisherport' ] } / ) options [ 'publisherport' ] = options [ 'publisherport' ] . to_i + 1 options [ 'publisherport' ] = options [ 'publisherport' ] . to_s end if options [ 'verbose' ] == true handle_output ( options , "Information: Setting publisher port to #{options['publisherport']}" ) end return options end
Check the publisher port isn't being used
Check the publisher port isn ' t being used
options
<not_specific>