package config;

use warnings;
use strict;

use server;
use File::Slurp;

sub shared {
	my ($name, $value) = @_;

	my $path ="$server::base_dir/conf/$server::ip/$name";
	if ( defined $value ) {
		write_file $path, $value;
	} else {
		$value = read_file $path if -e $path;
	}
	return $value;
}

sub for_ip {
	my $ip = shift;
	$tftp::dir = "$server::base_dir/tftp/live-helper/tftpboot";
	$dhcpd::file = "pxelinux.0";
}

1;
