#!/usr/local/bin/perl # edit_conf.cgi # Display ha_conf options require './heartbeat-lib.pl'; &ui_print_header(undef, $text{'conf_title'}, ""); @conf = &get_ha_config(); print "
\n"; print "\n"; print "\n"; print "
$text{'conf_header'}
\n"; @serials = &find("serial", \@conf); print "\n"; print "\n"; $baud = &find("baud", \@conf); print "\n", $baud; # changed (Christof Amelunxen, 22.08.2003) # udp directive replaced by bcast @bcasts = &find("bcast", \@conf); print "\n", join(" ", @bcasts); $udpport = &find("udpport", \@conf); print "\n", $udpport; $mcast = &find("mcast", \@conf); print "\n"; $keepalive = &find("keepalive", \@conf); print "\n", $keepalive, $text{'conf_secs'}; $deadtime = &find("deadtime", \@conf); print "\n", $deadtime, $text{'conf_secs'}; $watchdog = &find("watchdog", \@conf); print "\n", $watchdog, &file_chooser_button("watchdog"); print "\n"; $logfile = &find("logfile", \@conf); print "\n", $logfile, &file_chooser_button("logfile"); $logfacility = &find("logfacility", \@conf); print "\n"; $initdead = &find("initdead", \@conf); print "\n", $initdead, $text{'conf_secs'}; # changed (Christof Amelunxen, 22.08.2003) # define failback behaviour print "\n"; print "
$text{'conf_serials'}\n"; for($i=0; $i<=@serials; $i++) { local $sfound; print "\n"; } print "
$text{'conf_baud'} \n"; printf " %s\n", $baud ? "" : "checked", $text{'default'}; printf "\n", $baud ? "checked" : ""; printf "
$text{'conf_bcasts'} \n"; printf " %s\n", @bcasts ? "" : "checked", $text{'conf_none'}; printf "\n", @bcasts ? "checked" : ""; printf "
$text{'conf_udpport'} \n"; printf " %s\n", $udpport ? "" : "checked", $text{'default'}; printf "\n", $udpport ? "checked" : ""; printf "
$text{'conf_mcast'} \n"; printf " %s
\n", $mcast ? "" : "checked", $text{'conf_none'}; printf "\n", $mcast ? "checked" : ""; @mcast = split(/\s+/, $mcast); $mloop = "\n"; print &text('conf_mcastv', "", "", "", "", $mloop),"
$text{'conf_keepalive'} \n"; printf " %s\n", $keepalive ? "" : "checked", $text{'default'}; printf "\n", $keepalive ? "checked" : ""; printf " %s
$text{'conf_deadtime'} \n"; printf " %s\n", $deadtime ? "" : "checked", $text{'default'}; printf "\n", $deadtime ? "checked" : ""; printf " %s
$text{'conf_watchdog'} \n"; printf " %s\n", $watchdog ? "" : "checked", $text{'conf_none'}; printf "\n", $watchdog ? "checked" : ""; printf " %s
$text{'conf_node'} \n"; print "
$text{'conf_logfile'} \n"; printf " %s\n", $logfile ? "" : "checked", $text{'conf_none'}; printf "\n", $logfile ? "checked" : ""; printf " %s
$text{'conf_logfacility'} \n"; printf " %s\n", $logfacility ? "" : "checked", $text{'default'}; printf "\n", $logfacility ? "checked" : ""; if (&foreign_check("syslog")) { local %sconfig = &foreign_config("syslog"); print "\n"; } else { printf "\n", $logfacility; } print "
$text{'conf_initdead'} \n"; printf " %s\n", $initdead ? "" : "checked", $text{'default'}; printf "\n", $initdead ? "checked" : ""; printf " %s
$text{'conf_nice_failback'} \n"; if (&version_atleast(1, 2, 0)) { $auto_failback = &find("auto_failback", \@conf); foreach $aa ("on", "off", "legacy", "") { printf " %s\n", $aa, $auto_failback eq $aa ? "checked" : "", $text{'conf_auto_'.$aa}; } } else { $nice_failback = &find("nice_failback", \@conf); printf " %s\n", $nice_failback ? "checked" : "", $text{'conf_enabled'}; printf " %s\n", $nice_failback ? "" : "checked", $text{'conf_disabled'}; } print "
\n"; print "
\n"; &ui_print_footer("", $text{'index_return'});