methods/ai_server.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 fix_server_dhcpd_range(options)
  copy      = []
  dhcp_file = options['dhcpdfile'].to_s
  check_file_owner(options,dhcp_file,options['uid'])
  dhcpd_range = options['publisherhost'].split(/\./)[0..2]
  dhcpd_range = dhcpd_range.join(".")
  backup_file(options,dhcp_file)
  text        = File.readlines(dhcp_file)
  text.each do |line|
    if line.match(/range #{dhcpd_range}/) and not line.match(/^#/)
      line = "#"+line
      copy.push(line)
    else
      copy.push(line)
    end
  end
  File.open(dhcp_file,"w") {|file| file.puts copy}
  return
end
def fix_server_dhcpd_range ( options ) copy = [ ] dhcp_file = options [ 'dhcpdfile' ] . to_s check_file_owner ( options , dhcp_file , options [ 'uid' ] ) dhcpd_range = options [ 'publisherhost' ] . split ( / \. / ) [ 0 .. 2 ] dhcpd_range = dhcpd_range . join ( "." ) backup_file ( options , dhcp_file ) text = File . readlines ( dhcp_file ) text . each do | line | if line . match ( / range  #{ dhcpd_range } / ) and not line . match ( / ^# / ) line = "#" + line copy . push ( line ) else copy . push ( line ) end end File . open ( dhcp_file , "w" ) { | file | file . puts copy } 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>