methods/ai_client.rb
# Fix entry for client so it is given a fixed IP rather than one from the range
Fix entry for client so it is given a fixed IP rather than one from the range
Fix entry for client so it is given a fixed IP rather than one from the range
def update_ai_client_dhcpd_entry(options)
  copy = []
  text = File.readlines(dhcpd_file)
  options['ip']  = single_install_ip(options)
  options['mac'] = options['mac'].to_s.gsub(/:/,"")
  options['mac'] = options['mac'].to_s.upcase
  dhcpd_file     = "/etc/inet/dhcpd4.conf"
  backup_file(options,dhcpd_file)
  text.each do |line|
    if line.match(/^host #{options['mac']}/)
      copy.push("host #{options['name']} {")
      copy.push("  fixed-address #{options['ip']};")
    else
      copy.push(line)
    end
  end
  File.open(dhcp_file,"w") {|file| file.puts copy}
  print_contents_of_file(options,"",dhcp_file)
  return
end
def update_ai_client_dhcpd_entry ( options ) copy = [ ] text = File . readlines ( dhcpd_file ) options [ 'ip' ] = single_install_ip ( options ) options [ 'mac' ] = options [ 'mac' ] . to_s . gsub ( / : / , "" ) options [ 'mac' ] = options [ 'mac' ] . to_s . upcase dhcpd_file = "/etc/inet/dhcpd4.conf" backup_file ( options , dhcpd_file ) text . each do | line | if line . match ( / ^host  #{ options [ 'mac' ] } / ) copy . push ( "host #{options['name']} {" ) copy . push ( "  fixed-address #{options['ip']};" ) else copy . push ( line ) end end File . open ( dhcp_file , "w" ) { | file | file . puts copy } print_contents_of_file ( options , "" , dhcp_file ) return end
Fix entry for client so it is given a fixed IP rather than one from the range
Fix entry for client so it is given a fixed IP rather than one from the range
options
<not_specific>