PATH:
usr
/
share
/
augeas
/
lenses
/
dist
(* Intefraces module for Augeas Author: Free Ekanayaka <free@64studio.com> Reference: man dhclient.conf The only difference with the reference syntax is that this lens assumes that statements end with a new line, while the reference syntax allows new statements to be started right after the trailing ";" of the previous statement. This should not be a problem in real-life configuration files as statements get usually splitted across several lines, rather than merged in a single one. *) module Dhclient = autoload xfm (************************************************************************ * USEFUL PRIMITIVES *************************************************************************) let eol = Util.eol let comment = Util.comment let comment_or_eol = Util.comment_or_eol let empty = Util.empty (* Define separators *) let sep_spc = del /[ \t\n]+/ " " let sep_scl = del /[ \t]*;/ ";" let sep_obr = del /[ \t\n]*\{\n]*/ " {\n" let sep_cbr = del /[ \t\n]*\}/ " }" let sep_com = del /[ \t\n]*,[ \t\n]*/ "," let sep_slh = del "\/" "/" let sep_col = del ":" ":" let sep_eq = del /[ \t]*=[ \t]*/ "=" (* Define basic types *) let word = /[A-Za-z0-9_.-]+(\[[0-9]+\])?/ (* Define fields *) (* TODO: there could be a " " in the middle of a value ... *) let sto_to_spc = store /[^\\#,;{}" \t\n]+|"[^\\#"\n]+"/ let sto_to_spc_noeval = store /[^=\\#,;{}" \t\n]|[^=\\#,;{}" \t\n][^\\#,;{}" \t\n]*|"[^\\#"\n]+"/ let sto_to_scl = store /[^ \t\n][^;\n]+[^ \t]|[^ \t;\n]+/ let rfc_code = [ key "code" . sep_spc . store word ] . sep_eq . [ label "value" . sto_to_scl ] let eval = [ label "#eval" . Sep.equal . sep_spc . sto_to_scl ] let sto_number = store /[0-9][0-9]*/ (************************************************************************ * SIMPLE STATEMENTS *************************************************************************) let stmt_simple_re = "timeout" | "retry" | "select-timeout" | "reboot" | "backoff-cutoff" | "initial-interval" | "do-forward-updates" | "reject" let stmt_simple = [ key stmt_simple_re . sep_spc . sto_to_spc . sep_scl . comment_or_eol ] (************************************************************************ * ARRAY STATEMENTS *************************************************************************) (* TODO: the array could also be empty, like in the request statement *) let stmt_array_re = "media" | "request" | "require" let stmt_array = [ key stmt_array_re . sep_spc . counter "stmt_array" . [ seq "stmt_array" . sto_to_spc ] . [ sep_com . seq "stmt_array" . sto_to_spc ]* . sep_scl . comment_or_eol ] (************************************************************************ * HASH STATEMENTS *************************************************************************) let stmt_hash_re = "send" | "option" let stmt_hash = [ key stmt_hash_re . sep_spc . [ key word . sep_spc . (sto_to_spc_noeval|rfc_code|eval) ] . sep_scl . comment_or_eol ] let stmt_opt_mod_re = "append" | "prepend" | "default" | "supersede" let stmt_opt_mod = [ key stmt_opt_mod_re . sep_spc . stmt_hash ] (************************************************************************ * BLOCK STATEMENTS *************************************************************************) let stmt_block_re = "interface" | "lease" | "alias" let stmt_block_opt_re = "interface" | "script" | "bootp" | "fixed-address" | "filename" | "server-name" | "medium" | "vendor option space" (* TODO: some options could take no argument like bootp *) let stmt_block_opt = [ key stmt_block_opt_re . sep_spc . sto_to_spc . sep_scl . comment_or_eol ] let stmt_block_date_re = "renew" | "rebind" | "expire" let stmt_block_date = [ key stmt_block_date_re . [ sep_spc . label "weekday" . sto_number ] . [ sep_spc . label "year" . sto_number ] . [ sep_slh . label "month" . sto_number ] . [ sep_slh . label "day" . sto_number ] . [ sep_spc . label "hour" . sto_number ] . [ sep_col . label "minute" . sto_number ] . [ sep_col . label "second" . sto_number ] . sep_scl . comment_or_eol ] let stmt_block_arg = sep_spc . sto_to_spc let stmt_block_entry = sep_spc . ( stmt_array | stmt_hash | stmt_opt_mod | stmt_block_opt | stmt_block_date ) let stmt_block = [ key stmt_block_re . stmt_block_arg? . sep_obr . stmt_block_entry+ . sep_cbr . comment_or_eol ] (************************************************************************ * LENS & FILTER *************************************************************************) let statement = (stmt_simple|stmt_opt_mod|stmt_array|stmt_hash|stmt_block) let lns = ( empty | comment | statement )* let filter = incl "/etc/dhcp3/dhclient.conf" . incl "/etc/dhcp/dhclient.conf" . incl "/etc/dhclient.conf" let xfm = transform lns filter
[+]
..
[-] mailscanner.aug
[edit]
[-] access.aug
[edit]
[-] gshadow.aug
[edit]
[-] activemq_conf.aug
[edit]
[-] gtkbookmarks.aug
[edit]
[-] activemq_xml.aug
[edit]
[-] hostname.aug
[edit]
[-] afs_cellalias.aug
[edit]
[-] mcollective.aug
[edit]
[-] aliases.aug
[edit]
[-] mdadm_conf.aug
[edit]
[-] anacron.aug
[edit]
[-] memcached.aug
[edit]
[-] approx.aug
[edit]
[-] group.aug
[edit]
[-] phpvars.aug
[edit]
[-] apt_update_manager.aug
[edit]
[-] grub.aug
[edit]
[-] puppet.aug
[edit]
[-] aptcacherngsecurity.aug
[edit]
[-] mongodbserver.aug
[edit]
[-] aptconf.aug
[edit]
[-] host_conf.aug
[edit]
[-] aptpreferences.aug
[edit]
[-] hosts.aug
[edit]
[-] aptsources.aug
[edit]
[-] hosts_access.aug
[edit]
[-] authorized_keys.aug
[edit]
[-] htpasswd.aug
[edit]
[-] automaster.aug
[edit]
[-] jettyrealm.aug
[edit]
[-] automounter.aug
[edit]
[-] mke2fs.aug
[edit]
[-] avahi.aug
[edit]
[-] jaas.aug
[edit]
[-] backuppchosts.aug
[edit]
[-] modprobe.aug
[edit]
[-] bbhosts.aug
[edit]
[-] jmxaccess.aug
[edit]
[-] bootconf.aug
[edit]
[-] modules.aug
[edit]
[-] build.aug
[edit]
[-] jmxpassword.aug
[edit]
[-] cachefilesd.aug
[edit]
[-] modules_conf.aug
[edit]
[-] carbon.aug
[edit]
[-] json.aug
[edit]
[-] cgconfig.aug
[edit]
[-] nagiosobjects.aug
[edit]
[-] cgrules.aug
[edit]
[-] kdump.aug
[edit]
[-] channels.aug
[edit]
[-] monit.aug
[edit]
[-] chrony.aug
[edit]
[-] multipath.aug
[edit]
[-] clamav.aug
[edit]
[-] keepalived.aug
[edit]
[-] cobblermodules.aug
[edit]
[-] known_hosts.aug
[edit]
[-] cobblersettings.aug
[edit]
[-] koji.aug
[edit]
[-] collectd.aug
[edit]
[-] mysql.aug
[edit]
[-] cpanel.aug
[edit]
[-] nagioscfg.aug
[edit]
[-] cron.aug
[edit]
[-] krb5.aug
[edit]
[-] crypttab.aug
[edit]
[-] netmasks.aug
[edit]
[-] cups.aug
[edit]
[-] ldif.aug
[edit]
[-] cyrus_imapd.aug
[edit]
[-] networkmanager.aug
[edit]
[-] darkice.aug
[edit]
[-] networks.aug
[edit]
[-] debctrl.aug
[edit]
[-] nrpe.aug
[edit]
[-] desktop.aug
[edit]
[-] ldso.aug
[edit]
[-] device_map.aug
[edit]
[-] lightdm.aug
[edit]
[-] dhclient.aug
[edit]
[-] nginx.aug
[edit]
[-] dhcpd.aug
[edit]
[-] limits.aug
[edit]
[-] dhcpd_140.aug
[edit]
[-] login_defs.aug
[edit]
[-] dns_zone.aug
[edit]
[-] ntpd.aug
[edit]
[-] dnsmasq.aug
[edit]
[-] nsswitch.aug
[edit]
[-] dovecot.aug
[edit]
[-] ntp.aug
[edit]
[-] dpkg.aug
[edit]
[-] odbc.aug
[edit]
[-] dput.aug
[edit]
[-] openshift_http.aug
[edit]
[-] erlang.aug
[edit]
[-] openshift_config.aug
[edit]
[-] ethers.aug
[edit]
[-] pamconf.aug
[edit]
[-] exports.aug
[edit]
[-] logrotate.aug
[edit]
[-] fai_diskconfig.aug
[edit]
[-] openvpn.aug
[edit]
[-] fonts.aug
[edit]
[-] pagekite.aug
[edit]
[-] fstab.aug
[edit]
[-] pam.aug
[edit]
[-] fuse.aug
[edit]
[-] passwd.aug
[edit]
[-] gdm.aug
[edit]
[-] httpd.aug
[edit]
[-] postfix_access.aug
[edit]
[-] inetd.aug
[edit]
[-] pbuilder.aug
[edit]
[-] inifile.aug
[edit]
[-] pg_hba.aug
[edit]
[-] inittab.aug
[edit]
[-] pgbouncer.aug
[edit]
[-] inputrc.aug
[edit]
[-] logwatch.aug
[edit]
[-] interfaces.aug
[edit]
[-] lokkit.aug
[edit]
[-] iproute2.aug
[edit]
[-] mailscanner_rules.aug
[edit]
[-] iptables.aug
[edit]
[-] php.aug
[edit]
[-] iscsid.aug
[edit]
[-] lvm.aug
[edit]
[-] util.aug
[edit]
[-] openshift_quickstarts.aug
[edit]
[-] xinetd.aug
[edit]
[-] postfix_main.aug
[edit]
[-] xendconfsxp.aug
[edit]
[-] postfix_master.aug
[edit]
[-] vfstab.aug
[edit]
[-] postfix_sasl_smtpd.aug
[edit]
[-] vmware_config.aug
[edit]
[-] postfix_transport.aug
[edit]
[-] xml.aug
[edit]
[-] postfix_virtual.aug
[edit]
[-] xorg.aug
[edit]
[-] postgresql.aug
[edit]
[-] xymon.aug
[edit]
[-] properties.aug
[edit]
[-] xymon_alerting.aug
[edit]
[-] protocols.aug
[edit]
[-] yum.aug
[edit]
[-] puppet_auth.aug
[edit]
[-] puppetfile.aug
[edit]
[-] vsftpd.aug
[edit]
[-] puppetfileserver.aug
[edit]
[-] anaconda.aug
[edit]
[-] pylonspaste.aug
[edit]
[-] pythonpaste.aug
[edit]
[-] qpid.aug
[edit]
[-] quote.aug
[edit]
[-] rabbitmq.aug
[edit]
[-] redis.aug
[edit]
[-] webmin.aug
[edit]
[-] reprepro_uploaders.aug
[edit]
[-] resolv.aug
[edit]
[-] rhsm.aug
[edit]
[-] rmt.aug
[edit]
[-] rsyncd.aug
[edit]
[-] rsyslog.aug
[edit]
[-] rx.aug
[edit]
[-] samba.aug
[edit]
[-] schroot.aug
[edit]
[-] securetty.aug
[edit]
[-] sep.aug
[edit]
[-] services.aug
[edit]
[-] shadow.aug
[edit]
[-] shells.aug
[edit]
[-] shellvars.aug
[edit]
[-] shellvars_list.aug
[edit]
[-] simplelines.aug
[edit]
[-] simplevars.aug
[edit]
[-] sip_conf.aug
[edit]
[-] slapd.aug
[edit]
[-] slapd_140.aug
[edit]
[-] smbusers.aug
[edit]
[-] solaris_system.aug
[edit]
[-] soma.aug
[edit]
[-] spacevars.aug
[edit]
[-] splunk.aug
[edit]
[-] squid.aug
[edit]
[-] ssh.aug
[edit]
[-] sshd.aug
[edit]
[-] sshd_140.aug
[edit]
[-] sssd.aug
[edit]
[-] stunnel.aug
[edit]
[-] subversion.aug
[edit]
[-] sudoers.aug
[edit]
[-] sysconfig.aug
[edit]
[-] sysconfig_route.aug
[edit]
[-] sysctl.aug
[edit]
[-] syslog.aug
[edit]
[-] systemd.aug
[edit]
[-] thttpd.aug
[edit]
[-] tuned.aug
[edit]
[-] up2date.aug
[edit]
[-] updatedb.aug
[edit]
[-] wine.aug
[edit]