5 require './cfengine-lib.pl';
7 &error_setup($text{'push_err'});
9 # Validate and parse inputs
10 ($oldhosts, $opts) = &get_cfrun_hosts();
11 $in{'domain'} =~ /^[A-Za-z0-9\.\-]+$/ || &error($text{'push_edomain'});
12 $opts->{'domain'} = $in{'domain'};
13 $opts->{'access'} = join(",", split(/\s+/, $in{'access'}));
14 for($i=0; defined($in{"host_$i"}); $i++) {
15 next if (!$in{"host_$i"});
16 &to_ipaddress($in{"host_$i"}) ||
17 &error(&text('push_ehost', $in{"host_$i"}));
18 &to_ipaddress($in{"host_$i"}) ne &to_ipaddress(&get_system_hostname())||
19 &error(&text('push_ethis', $in{"host_$i"}));
20 push(@hosts, [ $in{"host_$i"}, $in{"opts_$i"} ] );
24 &lock_file($cfrun_hosts);
25 &save_cfrun_hosts(\@hosts, $opts);
26 &unlock_file($cfrun_hosts);