Hi,

Is there any reason of not using shell variables in rc.conf?
I want to tune rc.conf for easy editing and administration. Take for
example jail_list or cloned_interfaces with 10+ entries:


# interfaces
cloned_interfaces="carp1 bce0.10 carp10 bce0.20 carp20"

ifconfig_bce0_10="10.0.0.1/24"
ifconfig_bce0_20="10.0.1.1/24"
ifconfig_bce0_20_alias0="10.0.1.2/32"
ifconfig_carp10="vhid 10 advskew 100 pass MySecret 10.0.0.100/32"
ifconfig_carp20="vhid 20 advskew 15  pass MySecret 10.0.1.100/32"

# jails
jail_list="ns mail"

jail_ns_hostname="ns"
jail_ns_ip="10.10.10.1"

jail_mail_hostname="mail"
jail_mail_ip="10.10.10.2"


Instead I can rewrite this to:


# interfaces
cloned_interfaces="${cloned_interfaces} bce0.10"
ifconfig_bce0_10="10.0.0.1/24"

cloned_interfaces="${cloned_interfaces} bce0.20"
ifconfig_bce0_20="10.0.1.1/24"
ifconfig_bce0_20_alias0="10.0.1.2/32"

cloned_interfaces="${cloned_interfaces} carp10"
ifconfig_carp10="vhid 10 advskew 100 pass MySecret 10.0.0.100/32"

cloned_interfaces="${cloned_interfaces} carp20"
ifconfig_carp20="vhid 20 advskew 15  pass MySecret 10.0.1.100/32"

# jails
jail_list="${jail_list} ns"
jail_ns_hostname="ns"
jail_ns_ip="10.10.10.1"

jail_list="${jail_list} mail"
jail_mail_hostname="mail"
jail_mail_ip="10.10.10.2"


Now I can just comment out unused interface or jail, and it won't start up.





-- 
Artis Caune

    Everything should be made as simple as possible, but not simpler.
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to