methods/ai_server.rb
# Touch /etc/inet/dhcpd4.conf if it doesn't exist
# If you don't do this it won't actually write to the file
Touch /etc/inet/dhcpd4.conf if it doesn't exist
If you don't do this it won't actually write to the file
Touch / etc / inet / dhcpd4 . conf if it doesn ' t exist If you don ' t do this it won ' t actually write to the file
def check_dhcpd4_conf(options)
  if options['host-os-name'].to_s.match(/SunOS/)
    file="/etc/inet/dhcpd4.conf"
    if options['verbose'] == true
      handle_output(options,"Checking:\t#{file} exists")
    end
    if not File.exist?(file)
      message = "Information:\tCreating "+file
      command = "touch #{file}"
      output  = execute_command(options,message,command)
    else
      backup_file = file+".preai"
      message = "Information:\tArchiving file "+file+" to "+backup_file
      command = "cp #{file} #{backup_file}"
      output  = execute_command(options,message,command)
    end
  end
  return
end
def check_dhcpd4_conf ( options ) if options [ 'host-os-name' ] . to_s . match ( / SunOS / ) file = "/etc/inet/dhcpd4.conf" if options [ 'verbose' ] == true handle_output ( options , "Checking:\t#{file} exists" ) end if not File . exist? ( file ) message = "Information:\tCreating " + file command = "touch #{file}" output = execute_command ( options , message , command ) else backup_file = file + ".preai" message = "Information:\tArchiving file " + file + " to " + backup_file command = "cp #{file} #{backup_file}" output = execute_command ( options , message , command ) end end return end
Touch /etc/inet/dhcpd4.conf if it doesn't exist
If you don't do this it won't actually write to the file
Touch / etc / inet / dhcpd4 . conf if it doesn ' t exist If you don ' t do this it won ' t actually write to the file
options
<not_specific>