1613d7da7SDevin Teske.\" Copyright (c) 2011-2016 Devin Teske 22a357efaSDevin Teske.\" All rights reserved. 32a357efaSDevin Teske.\" 42a357efaSDevin Teske.\" Redistribution and use in source and binary forms, with or without 52a357efaSDevin Teske.\" modification, are permitted provided that the following conditions 62a357efaSDevin Teske.\" are met: 72a357efaSDevin Teske.\" 1. Redistributions of source code must retain the above copyright 82a357efaSDevin Teske.\" notice, this list of conditions and the following disclaimer. 92a357efaSDevin Teske.\" 2. Redistributions in binary form must reproduce the above copyright 102a357efaSDevin Teske.\" notice, this list of conditions and the following disclaimer in the 112a357efaSDevin Teske.\" documentation and/or other materials provided with the distribution. 122a357efaSDevin Teske.\" 132a357efaSDevin Teske.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 142a357efaSDevin Teske.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 152a357efaSDevin Teske.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 162a357efaSDevin Teske.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 172a357efaSDevin Teske.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 182a357efaSDevin Teske.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 192a357efaSDevin Teske.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 202a357efaSDevin Teske.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 212a357efaSDevin Teske.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 222a357efaSDevin Teske.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 232a357efaSDevin Teske.\" SUCH DAMAGE. 242a357efaSDevin Teske.\" 252a357efaSDevin Teske.\" $FreeBSD$ 262a357efaSDevin Teske.\" 27*1a0bd266SJose Luis Duran.Dd April 3, 2022 282a357efaSDevin Teske.Dt SYSRC 8 292a357efaSDevin Teske.Os 302a357efaSDevin Teske.Sh NAME 312a357efaSDevin Teske.Nm sysrc 322a357efaSDevin Teske.Nd safely edit system rc files 332a357efaSDevin Teske.Sh SYNOPSIS 342a357efaSDevin Teske.Nm 354fb1de43SDevin Teske.Op Fl cdDeEFhinNqvx 364fb1de43SDevin Teske.Op Fl s Ar name 372a357efaSDevin Teske.Op Fl f Ar file 382a357efaSDevin Teske.Op Fl j Ar jail | Fl R Ar dir 393a40fd5eSDevin Teske.Ar name Ns Op Ns Oo +|- Oc Ns = Ns Ar value 402a357efaSDevin Teske.Ar ... 412a357efaSDevin Teske.Nm 424fb1de43SDevin Teske.Op Fl cdDeEFhinNqvx 434fb1de43SDevin Teske.Op Fl s Ar name 442a357efaSDevin Teske.Op Fl f Ar file 452a357efaSDevin Teske.Op Fl j Ar jail | Fl R Ar dir 462a357efaSDevin Teske.Fl a | A 474fb1de43SDevin Teske.Nm 484fb1de43SDevin Teske.Op Fl E 494fb1de43SDevin Teske.Op Fl s Ar name 504fb1de43SDevin Teske.Op Fl f Ar file 514fb1de43SDevin Teske.Fl l 524fb1de43SDevin Teske.Nm 534fb1de43SDevin Teske.Op Fl eEqv 544fb1de43SDevin Teske.Fl L 554fb1de43SDevin Teske.Op Ar name ... 562a357efaSDevin Teske.Sh DESCRIPTION 572a357efaSDevin TeskeThe 582a357efaSDevin Teske.Nm 592a357efaSDevin Teskeutility retrieves 602a357efaSDevin Teske.Xr rc.conf 5 612a357efaSDevin Teskevariables from the collection of system rc files and allows processes with 622a357efaSDevin Teskeappropriate privilege to change values in a safe and effective manner. 632a357efaSDevin Teske.Pp 642a357efaSDevin TeskeThe following options are available: 652a357efaSDevin Teske.Bl -tag -width indent+ 662a357efaSDevin Teske.It Fl a 672a357efaSDevin TeskeDump a list of all non-default configuration variables. 682a357efaSDevin Teske.It Fl A 692a357efaSDevin TeskeDump a list of all configuration variables 702a357efaSDevin Teske.Pq incl. defaults . 714cc57221SDevin Teske.It Fl c 72e6c03065SDevin TeskeCheck only. 73e6c03065SDevin TeskeFor querying, return success if all requested variables are set 74e6c03065SDevin Teske.Pq even if NULL , 75e6c03065SDevin Teskeotherwise return error status. 76e6c03065SDevin TeskeFor assignments, return success if no changes are required, otherwise failure. 774cc57221SDevin TeskeIf verbose 784cc57221SDevin Teske.Pq see Dq Fl v 79e6c03065SDevin Teskeprints a message stating whether variables are set and/or changes are required. 802a357efaSDevin Teske.It Fl d 812a357efaSDevin TeskePrint a description of the given variable. 822a357efaSDevin Teske.It Fl D 832a357efaSDevin TeskeShow default value(s) only (this is the same as setting RC_CONFS to NULL or 842a357efaSDevin Teskepassing `-f' with a NULL file-argument). 852a357efaSDevin Teske.It Fl e 862a357efaSDevin TeskePrint query results as 87379cb6baSDevin Teske.Xr sh 1 88379cb6baSDevin Teskecompatible syntax 89379cb6baSDevin Teske.Pq for example, Ql var=value . 90379cb6baSDevin TeskeIgnored if either 91379cb6baSDevin Teske.Ql Fl n 92379cb6baSDevin Teskeor 93379cb6baSDevin Teske.Ql Fl F 942a357efaSDevin Teskeis specified. 954fb1de43SDevin Teske.It Fl E 964fb1de43SDevin TeskeWhen given 974fb1de43SDevin Teske.Sq Fl l 984fb1de43SDevin Teskeor 994fb1de43SDevin Teske.Sq Fl L 1004fb1de43SDevin Tesketo list configuration files, only list those that exist. 1014fb1de43SDevin TeskeWhen changing a setting, prefer to modify existing files. 1022a357efaSDevin Teske.It Fl f Ar file 1032a357efaSDevin TeskeOperate on the specified file(s) instead of the files obtained by reading the 1042a357efaSDevin Teske.Sq rc_conf_files 1052a357efaSDevin Teskeentry in the 1062a357efaSDevin Teske.Ev RC_DEFAULTS 1072a357efaSDevin Teskefile. 1082a357efaSDevin TeskeThis option can be specified multiple times for additional files. 1092a357efaSDevin Teske.It Fl F 1102a357efaSDevin TeskeShow only the last 1112a357efaSDevin Teske.Xr rc.conf 5 1122a357efaSDevin Teskefile each directive is in. 1132a357efaSDevin Teske.It Fl h 1142a357efaSDevin TeskePrint a short usage message to stderr and exit. 1152a357efaSDevin Teske.It Fl -help 1162a357efaSDevin TeskePrint a full usage statement to stderr and exit. 1172a357efaSDevin Teske.It Fl i 1182a357efaSDevin TeskeIgnore unknown variables. 1192a357efaSDevin Teske.It Fl j Ar jail 1202a357efaSDevin TeskeThe 1212a357efaSDevin Teske.Ar jid 1222a357efaSDevin Teskeor name of the 1232a357efaSDevin Teske.Ar jail 1242a357efaSDevin Tesketo operate within 1252a357efaSDevin Teske.Pq overrides So Fl R Ar dir Sc ; requires Xr jexec 8 . 1264fb1de43SDevin Teske.It Fl l 1274fb1de43SDevin TeskeList configuration files used at startup on stdout and exit. 1284fb1de43SDevin Teske.It Fl L 1294fb1de43SDevin TeskeList all configuration files including rc.conf.d entries on stdout and exit. 1304fb1de43SDevin TeskeCan be combined with 1314fb1de43SDevin Teske.Sq Fl v 1324fb1de43SDevin Teskeor 1334fb1de43SDevin Teske.Sq Fl e 1344fb1de43SDevin Tesketo show service names. 1354fb1de43SDevin Teske.Nm 1364fb1de43SDevin Teskeexits with success if all named services are installed, failure otherwise. 1372a357efaSDevin Teske.It Fl n 1382a357efaSDevin TeskeShow only variable values, not their names. 1392a357efaSDevin Teske.It Fl N 1402a357efaSDevin TeskeShow only variable names, not their values. 1412a357efaSDevin Teske.It Fl q 1423dacd67eSJoel DahlQuiet. 143e6c03065SDevin TeskeDisable verbose and hide certain errors. 1444fb1de43SDevin TeskeWhen combined with 1454fb1de43SDevin Teske.Sq Fl L 1464fb1de43SDevin Teskeand one or more 1474f2f8d7dSMateusz Piotrowski.Ar name 1484fb1de43SDevin Teskearguments, provide only exit status and no output. 1492a357efaSDevin Teske.It Fl R Ar dir 1502a357efaSDevin TeskeOperate within the root directory 151e6c03065SDevin Teske.Sq Ar dir 1522a357efaSDevin Teskerather than 153e6c03065SDevin Teske.Sq / . 1544fb1de43SDevin Teske.It Fl s Ar name 1554fb1de43SDevin TeskeIf an 1564fb1de43SDevin Teske.Li rc.d 1574fb1de43SDevin Teskescript of 1584fb1de43SDevin Teske.Ar name 1594fb1de43SDevin Teskeexists 1604fb1de43SDevin Teske.Po 1614fb1de43SDevin Teskein 1624fb1de43SDevin Teske.Dq /etc/rc.d 1634fb1de43SDevin Teskeor 1644fb1de43SDevin Teske.Li local_startup 1654fb1de43SDevin Teskedirectories 1664fb1de43SDevin Teske.Pc , 1674fb1de43SDevin Teskeprocess its 1684fb1de43SDevin Teske.Dq rc.conf.d 1694fb1de43SDevin Teskeentries as potential overrides to 1704fb1de43SDevin Teske.Sq rc_conf_files . 1714fb1de43SDevin TeskeSee 1724fb1de43SDevin Teske.Xr rc.subr 8 1734fb1de43SDevin Teskefor additional information on 1744fb1de43SDevin Teske.Dq rc.conf.d . 1754fb1de43SDevin TeskeCan be combined with 1764fb1de43SDevin Teske.Sq Fl l 1774fb1de43SDevin Tesketo list configuration files used by service at startup. 1782a357efaSDevin Teske.It Fl v 1793dacd67eSJoel DahlVerbose. 1803dacd67eSJoel DahlPrint the pathname of the specific 1812a357efaSDevin Teske.Xr rc.conf 5 1822a357efaSDevin Teskefile where the directive was found. 1833e74984cSDevin Teske.It Fl -version 1843e74984cSDevin TeskePrint version information to stdout and exit. 1852a357efaSDevin Teske.It Fl x 1862a357efaSDevin TeskeRemove variable(s) from specified file(s). 1872a357efaSDevin Teske.El 1882a357efaSDevin Teske.Pp 189e6c03065SDevin TeskeThis utility has a similar syntax to 1902a357efaSDevin Teske.Xr sysctl 8 . 1912a357efaSDevin TeskeIt shares the `-e' and `-n' options 1922a357efaSDevin Teske.Pq detailed above 1932a357efaSDevin Teskeand also has the same 1942a357efaSDevin Teske.Ql name[=value] 195e6c03065SDevin Teskesyntax for making queries/assignments. 196a7bdf21cSDevin TeskeIn addition 1973a40fd5eSDevin Teske.Pq but unlike Xr sysctl 8 , 198a7bdf21cSDevin Teske.Ql name+=value 1993a40fd5eSDevin Teskeis supported for adding items to values 2003a40fd5eSDevin Teske.Pq see APPENDING VALUES 2013a40fd5eSDevin Teskeand 2023a40fd5eSDevin Teske.Ql name-=value 2033a40fd5eSDevin Teskeis supported for removing items from values 2043a40fd5eSDevin Teske.Pq see SUBTRACTING VALUES . 2052a357efaSDevin Teske.Pp 2062a357efaSDevin TeskeHowever, while 2072a357efaSDevin Teske.Xr sysctl 8 2082a357efaSDevin Teskeserves to query/modify MIBs in the entrant kernel, 209be15d0e4SJoel Dahl.Nm 2102a357efaSDevin Teskeinstead works on values in the system 2112a357efaSDevin Teske.Xr rc.conf 5 2122a357efaSDevin Teskeconfiguration files. 2132a357efaSDevin Teske.Pp 2142a357efaSDevin TeskeThe list of system configuration files is configured in the file 2152a357efaSDevin Teske.Ql /etc/defaults/rc.conf 2162a357efaSDevin Teskewithin the variable 2172a357efaSDevin Teske.Ql rc_conf_files , 2183dacd67eSJoel Dahlwhich by-default contains a space-separated list of pathnames. 2194f2f8d7dSMateusz PiotrowskiOn all 2204f2f8d7dSMateusz Piotrowski.Fx 2213dacd67eSJoel Dahlsystems, this defaults to the value "/etc/rc.conf /etc/rc.conf.local". 2223dacd67eSJoel DahlEach 2233dacd67eSJoel Dahlpathname is sourced in-order upon startup. 2243dacd67eSJoel DahlIt is in the same fashion that 2252a357efaSDevin Teske.Nm 2262a357efaSDevin Teskesources the configuration files before returning the value of the given 2272a357efaSDevin Teskevariable. 2282a357efaSDevin Teske.Pp 2292a357efaSDevin TeskeWhen supplied a variable name, 2302a357efaSDevin Teske.Nm 2313dacd67eSJoel Dahlwill return the value of the variable. 2323dacd67eSJoel DahlIf the variable does not appear in any 2332a357efaSDevin Teskeof the configured 2342a357efaSDevin Teske.Ql rc_conf_files , 2352a357efaSDevin Teskean error is printed and error status is returned. 2362a357efaSDevin Teske.Pp 2372a357efaSDevin TeskeWhen changing values of a given variable, it does not matter if the variable 2382a357efaSDevin Teskeappears in any of the 2392a357efaSDevin Teske.Ql rc_conf_files 2403dacd67eSJoel Dahlor not. 2413dacd67eSJoel DahlIf the variable does not appear in any of the files, it is appended to 2422a357efaSDevin Teskethe end of the first pathname in the 2432a357efaSDevin Teske.Ql rc_conf_files 2443dacd67eSJoel Dahlvariable. 2453dacd67eSJoel DahlOtherwise, 2462a357efaSDevin Teske.Nm 2472a357efaSDevin Teskewill replace only the last-occurrence in the last-file found to contain the 2483dacd67eSJoel Dahlvariable. 2493dacd67eSJoel DahlThis gets the value to take effect next boot without heavily 2502a357efaSDevin Teskemodifying these integral files (yet taking care not to allow the file to 2512a357efaSDevin Teskegrow unwieldy should 2522a357efaSDevin Teske.Nm 2532a357efaSDevin Teskebe called repeatedly). 2543a40fd5eSDevin Teske.Sh APPENDING VALUES 2553a40fd5eSDevin TeskeWhen using the 2563a40fd5eSDevin Teske.Ql key+=value 2573a40fd5eSDevin Teskesyntax to add items to existing values, 2583a40fd5eSDevin Teskethe first character of the value is taken as the delimiter separating items 25997ee0399SDevin Teske.Pq usually Qo " " Qc or Qo , Qc . 2603a40fd5eSDevin TeskeFor example, in the following statement: 2618fdb5185SDevin Teske.Bl -item -offset indent 2628fdb5185SDevin Teske.It 2633a40fd5eSDevin Teske.Nm 2643a40fd5eSDevin Teskecloned_interfaces+=" gif0" 2653a40fd5eSDevin Teske.El 2663a40fd5eSDevin Teske.Pp 2673a40fd5eSDevin Teskethe first character is a space, informing 2683a40fd5eSDevin Teske.Nm 2693a40fd5eSDevin Teskethat existing values are to be considered separated by whitespace. 2703a40fd5eSDevin TeskeIf 2713a40fd5eSDevin Teske.Ql gif0 2723a40fd5eSDevin Teskeis not found in the existing value for 2733a40fd5eSDevin Teske.Va cloned_interfaces , 2743a40fd5eSDevin Teskeit is added 2753a40fd5eSDevin Teske.Pq with delimiter only if existing value is non-NULL . 2763a40fd5eSDevin Teske.Pp 2773a40fd5eSDevin TeskeFor convenience, if the first character is alpha-numeric 2783a40fd5eSDevin Teske.Pq letters A-Z, a-z, or numbers 0-9 , 2796350eae8SDevin Teskedot 2804f2f8d7dSMateusz Piotrowski.Pq Li \&. , 2816350eae8SDevin Teskeor slash 2826350eae8SDevin Teske.Pq Li / , 2833a40fd5eSDevin Teske.Nm 2843a40fd5eSDevin Teskeuses the default setting of whitespace as separator. 2853a40fd5eSDevin TeskeFor example, the above and below statements are equivalent since 2863a40fd5eSDevin Teske.Dq gif0 2873a40fd5eSDevin Teskestarts with an alpha-numeric character 2883a40fd5eSDevin Teske.Pq the letter Li g : 2898fdb5185SDevin Teske.Bl -item -offset indent 2908fdb5185SDevin Teske.It 2913a40fd5eSDevin Teske.Nm 2923a40fd5eSDevin Teskecloned_interfaces+=gif0 2933a40fd5eSDevin Teske.El 2943a40fd5eSDevin Teske.Pp 2953a40fd5eSDevin TeskeTake the following sequence for example: 2968fdb5185SDevin Teske.Bl -item -offset indent 2978fdb5185SDevin Teske.It 2983a40fd5eSDevin Teske.Nm 2993a40fd5eSDevin Teskecloned_interfaces= # start with NULL 3008fdb5185SDevin Teske.It 3013a40fd5eSDevin Teske.Nm 3023a40fd5eSDevin Teskecloned_interfaces+=gif0 3033a40fd5eSDevin Teske.Dl # NULL -> `gif0' Pq NB: no preceding delimiter 3048fdb5185SDevin Teske.It 3053a40fd5eSDevin Teske.Nm 3063a40fd5eSDevin Teskecloned_interfaces+=gif0 # no change 3078fdb5185SDevin Teske.It 3083a40fd5eSDevin Teske.Nm 3093a40fd5eSDevin Teskecloned_interfaces+="tun0 gif0" 3103a40fd5eSDevin Teske.Dl # `gif0' -> `gif0 tun0' Pq NB: no duplication 3113a40fd5eSDevin Teske.El 3123a40fd5eSDevin Teske.Pp 3133a40fd5eSDevin Teske.Nm 3143a40fd5eSDevin Teskeprevents the same value from being added if already there. 3153a40fd5eSDevin Teske.Sh SUBTRACTING VALUES 3163a40fd5eSDevin TeskeWhen using the 3173a40fd5eSDevin Teske.Ql key-=value 3183a40fd5eSDevin Teskesyntax to remove items from existing values, 3193a40fd5eSDevin Teskethe first character of the value is taken as the delimiter separating items 32097ee0399SDevin Teske.Pq usually Qo " " Qc or Qo , Qc . 3213a40fd5eSDevin TeskeFor example, in the following statement: 3223a40fd5eSDevin Teske.Pp 3233a40fd5eSDevin Teske.Dl Nm cloned_interfaces-=" gif0" 3243a40fd5eSDevin Teske.Pp 3253a40fd5eSDevin Teskethe first character is a space, informing 3263a40fd5eSDevin Teske.Nm 3273a40fd5eSDevin Teskethat existing values are to be considered separated by whitespace. 3283a40fd5eSDevin TeskeIf 3293a40fd5eSDevin Teske.Ql gif0 3303a40fd5eSDevin Teskeis found in the existing value for 3313a40fd5eSDevin Teske.Va cloned_interfaces , 3323a40fd5eSDevin Teskeit is removed 3333a40fd5eSDevin Teske.Pq extra delimiters removed . 3343a40fd5eSDevin Teske.Pp 3353a40fd5eSDevin TeskeFor convenience, if the first character is alpha-numeric 3363a40fd5eSDevin Teske.Pq letters A-Z, a-z, or numbers 0-9 , 3376350eae8SDevin Teskedot 3384f2f8d7dSMateusz Piotrowski.Pq Li \&. , 3396350eae8SDevin Teskeor slash 3406350eae8SDevin Teske.Pq Li / , 3413a40fd5eSDevin Teske.Nm 3423a40fd5eSDevin Teskeuses the default setting of whitespace as separator. 3433a40fd5eSDevin TeskeFor example, the above and below statements are equivalent since 3443a40fd5eSDevin Teske.Dq gif0 3453a40fd5eSDevin Teskestarts with an alpha-numeric character 3463a40fd5eSDevin Teske.Pq the letter Li g : 3478fdb5185SDevin Teske.Bl -item -offset indent 3488fdb5185SDevin Teske.It 3493a40fd5eSDevin Teske.Nm 3503a40fd5eSDevin Teskecloned_interfaces-=gif0 3513a40fd5eSDevin Teske.El 3523a40fd5eSDevin Teske.Pp 3533a40fd5eSDevin TeskeTake the following sequence for example: 3548fdb5185SDevin Teske.Bl -item -offset indent 3558fdb5185SDevin Teske.It 3563a40fd5eSDevin Teske.Nm 3573a40fd5eSDevin Teskefoo="bar baz" # start 3588fdb5185SDevin Teske.It 3593a40fd5eSDevin Teske.Nm 3603a40fd5eSDevin Teskefoo-=bar # `bar baz' -> `baz' 3618fdb5185SDevin Teske.It 3623a40fd5eSDevin Teske.Nm 3633a40fd5eSDevin Teskefoo-=baz # `baz' -> NULL 3643a40fd5eSDevin Teske.El 3653a40fd5eSDevin Teske.Pp 3663a40fd5eSDevin Teske.Nm 3673a40fd5eSDevin Teskeremoves all occurrences of all items provided 3683a40fd5eSDevin Teskeand collapses extra delimiters between items. 3692a357efaSDevin Teske.Sh ENVIRONMENT 3702a357efaSDevin TeskeThe following environment variables are referenced by 3712a357efaSDevin Teske.Nm : 372bc3ccb90SDevin Teske.Bl -tag -width ".Ev RC_DEFAULTS" 3732a357efaSDevin Teske.It Ev RC_CONFS 3742a357efaSDevin TeskeOverride default 3752a357efaSDevin Teske.Ql rc_conf_files 3762a357efaSDevin Teske.Pq even if set to NULL . 3772a357efaSDevin Teske.It Ev RC_DEFAULTS 3782a357efaSDevin TeskeLocation of 3792a357efaSDevin Teske.Ql /etc/defaults/rc.conf 3802a357efaSDevin Teskefile. 3812a357efaSDevin Teske.El 3822a357efaSDevin Teske.Sh DEPENDENCIES 3832a357efaSDevin TeskeThe following standard commands are required by 3842a357efaSDevin Teske.Nm : 3852a357efaSDevin Teske.Pp 3862a357efaSDevin Teske.Xr awk 1 , 3872a357efaSDevin Teske.Xr cat 1 , 3882a357efaSDevin Teske.Xr chmod 1 , 3892a357efaSDevin Teske.Xr env 1 , 3902a357efaSDevin Teske.Xr grep 1 , 3912a357efaSDevin Teske.Xr mktemp 1 , 3922a357efaSDevin Teske.Xr mv 1 , 3932a357efaSDevin Teske.Xr rm 1 , 3942a357efaSDevin Teske.Xr sh 1 , 3952a357efaSDevin Teske.Xr stat 1 , 396872d9e39SNiclas Zeising.Xr tail 1 , 3978f6e6509SEdward Tomasz Napierala.Xr chown 8 , 398*1a0bd266SJose Luis Duran.Xr chroot 8 , 3998f6e6509SEdward Tomasz Napierala.Xr jls 8 , 400872d9e39SNiclas Zeisingand 401872d9e39SNiclas Zeising.Xr jexec 8 . 4022a357efaSDevin Teske.Sh FILES 4032a357efaSDevin Teske.Bl -tag -width ".Pa /etc/defaults/rc.conf" -compact 4042a357efaSDevin Teske.It Pa /etc/defaults/rc.conf 4052a357efaSDevin Teske.It Pa /etc/rc.conf 4062a357efaSDevin Teske.It Pa /etc/rc.conf.local 4074fb1de43SDevin Teske.It Pa /etc/rc.conf.d/name 4084fb1de43SDevin Teske.It Pa /etc/rc.conf.d/name/* 4094fb1de43SDevin Teske.It Pa /usr/local/etc/rc.conf.d/name 4104fb1de43SDevin Teske.It Pa /usr/local/etc/rc.conf.d/name/* 4112a357efaSDevin Teske.El 4122a357efaSDevin Teske.Sh EXAMPLES 4132a357efaSDevin TeskeBelow are some simple examples of how 4142a357efaSDevin Teske.Nm 4152a357efaSDevin Teskecan be used to query certain values from the 4162a357efaSDevin Teske.Xr rc.conf 5 4172a357efaSDevin Teskecollection of system configuration files: 4182a357efaSDevin Teske.Pp 4192a357efaSDevin Teske.Nm 4202a357efaSDevin Teskesshd_enable 4212a357efaSDevin Teske.Dl returns the value of $sshd_enable, usually YES or NO . 4222a357efaSDevin Teske.Pp 4232a357efaSDevin Teske.Nm 4242a357efaSDevin Teskedefaultrouter 4252a357efaSDevin Teske.Dl returns IP address of default router Pq if configured . 4262a357efaSDevin Teske.Pp 4272a357efaSDevin TeskeWorking on other files, such as 4282a357efaSDevin Teske.Xr crontab 5 : 4292a357efaSDevin Teske.Pp 4302a357efaSDevin Teske.Nm 4312a357efaSDevin Teske-f /etc/crontab MAILTO 4322a357efaSDevin Teske.Dl returns the value of the MAILTO setting Pq if configured . 4332a357efaSDevin Teske.Pp 434e8f6aafbSDevin TeskeAppending to existing values: 435e8f6aafbSDevin Teske.Pp 436e8f6aafbSDevin Teske.Nm 4373a40fd5eSDevin Teske\&cloned_interfaces+=gif0 4383a40fd5eSDevin Teske.Dl appends Qo gif0 Qc to $cloned_interfaces Pq see APPENDING VALUES . 4393a40fd5eSDevin Teske.Pp 4403a40fd5eSDevin Teske.Nm 4413a40fd5eSDevin Teske\&cloned_interfaces-=gif0 4423a40fd5eSDevin Teske.Dl removes Qo gif0 Qc from $cloned_interfaces Pq see SUBTRACTING VALUES . 443e8f6aafbSDevin Teske.Pp 4442a357efaSDevin TeskeIn addition to the above syntax, 4452a357efaSDevin Teske.Nm 4462a357efaSDevin Teskealso supports inline 4472a357efaSDevin Teske.Xr sh 1 4482a357efaSDevin TeskePARAMETER expansion for changing the way values are reported, shown below: 4492a357efaSDevin Teske.Pp 4502a357efaSDevin Teske.Nm 4512a357efaSDevin Teske\&'hostname%%.*' 4522a357efaSDevin Teske.Dl returns $hostname up to (but not including) first `.' . 4532a357efaSDevin Teske.Pp 4542a357efaSDevin Teske.Nm 4552a357efaSDevin Teske\&'network_interfaces%%[$IFS]*' 4562a357efaSDevin Teske.Dl returns first word of $network_interfaces . 4572a357efaSDevin Teske.Pp 4582a357efaSDevin Teske.Nm 4592a357efaSDevin Teske\&'ntpdate_flags##*[$IFS]' 4602a357efaSDevin Teske.Dl returns last word of $ntpdate_flags (time server address) . 4612a357efaSDevin Teske.Pp 4622a357efaSDevin Teske.Nm 4632a357efaSDevin Teskeusbd_flags-"default" 4642a357efaSDevin Teske.Dl returns $usbd_flags or "default" if unset or NULL . 4652a357efaSDevin Teske.Pp 4662a357efaSDevin Teske.Nm 4672a357efaSDevin Teskecloned_interfaces+"alternate" 4682a357efaSDevin Teske.Dl returns "alternate" if $cloned_interfaces is set . 4692a357efaSDevin Teske.Sh SEE ALSO 470872d9e39SNiclas Zeising.Xr rc.conf 5 , 4712a357efaSDevin Teske.Xr jail 8 , 4722a357efaSDevin Teske.Xr jexec 8 , 4738f6e6509SEdward Tomasz Napierala.Xr jls 8 , 4742a357efaSDevin Teske.Xr rc 8 , 4754f2f8d7dSMateusz Piotrowski.Xr rc.subr 8 , 4762a357efaSDevin Teske.Xr sysctl 8 4772a357efaSDevin Teske.Sh HISTORY 4782a357efaSDevin TeskeA 4792a357efaSDevin Teske.Nm 4802a357efaSDevin Teskeutility first appeared in 481385f5635SDevin Teske.Fx 9.2 . 4822a357efaSDevin Teske.Sh AUTHORS 48301c2b8acSBaptiste Daroussin.An Devin Teske Aq Mt dteske@FreeBSD.org 4842a357efaSDevin Teske.Sh THANKS TO 485da5069e1SEnji CooperBrandon Gooch, Enji Cooper, Julian Elischer, Pawel Jakub Dawidek, 486e6c03065SDevin TeskeCyrille Lefevre, Ross West, Stefan Esser, Marco Steinbach, Jilles Tjoelker, 487e6c03065SDevin TeskeAllan Jude, and Lars Engels for suggestions, help, and testing. 488