Commit 77ceba33 authored by Michael Nosthoff's avatar Michael Nosthoff
Browse files

README.md: fix code formatting

- quoting of values for OperationalState was broken.
- inline code only needs one backtick
parent 08ba60a2
Pipeline #188190629 passed with stages
in 3 minutes and 27 seconds
......@@ -10,7 +10,7 @@ The daemon listens for signals from systemd-networkd over dbus, so it should be
The daemon expects that scripts are 1) executable and 2) owned by root (gid = uid = 0), and will not execute scripts that are otherwise.
Scripts can be installed into these directories under ```/usr/lib/networkd-dispatcher``` for system packages, and ```/etc/networkd-dispatcher``` for local overrides:
Scripts can be installed into these directories under `/usr/lib/networkd-dispatcher` for system packages, and `/etc/networkd-dispatcher` for local overrides:
```
routable.d/
......@@ -32,31 +32,31 @@ configured.d/
networkd-dispatcher will execute any valid scripts in the directory that reflects the new state.
Scripts are executed in the alpha-numeric order in which they are named, starting with 0 and ending with z. For example, a script named ```50runme``` would run before ```99runmenext```.
Scripts are executed in the alpha-numeric order in which they are named, starting with 0 and ending with z. For example, a script named `50runme` would run before `99runmenext`.
Scripts are executed with some environment variables set. Some of these variables may not be set or may be set to an empty value, dependent upon the type of event. These can be used by scripts to conditionally take action based on a specific interface, state, etc.
- ```IFACE``` - interface that triggered the event
- `IFACE` - interface that triggered the event
- ```STATE``` - The destination state change for which a script is currently being invoked. May be any of the values listed as valid for `AdministrativeState` or `OperationalState`.
- `STATE` - The destination state change for which a script is currently being invoked. May be any of the values listed as valid for `AdministrativeState` or `OperationalState`.
- ```ESSID``` - for wlan connections, the ESSID the device is connected to
- `ESSID` - for wlan connections, the ESSID the device is connected to
- ```ADDR``` - the ipv4 address of the device
- `ADDR` - the ipv4 address of the device
- ```IP_ADDRS``` - space-delimited string of ipv4 address(es) assigned to the device (see note below)
- `IP_ADDRS` - space-delimited string of ipv4 address(es) assigned to the device (see note below)
- ```IP6_ADDRS``` - space-delimited string of ipv6 address(es) assigned to the device (see note below)
- `IP6_ADDRS` - space-delimited string of ipv6 address(es) assigned to the device (see note below)
- ```AdministrativeState``` - One of `pending`, `configuring`, `configured`, `unmanaged`, `failed` or `linger`.
- `AdministrativeState` - One of `pending`, `configuring`, `configured`, `unmanaged`, `failed` or `linger`.
- ```OperationalState``` - One of `off`, `no-carrier`, `dormant`, `carrier`, `degraded, `routable, configuring, or configured`. For more information about the network operational states exposed by systemd, see the `networkctl` manpage (`man networkctl`).
- `OperationalState` - One of `off`, `no-carrier`, `dormant`, `carrier`, `degraded`, `routable`, `configuring`, or `configured`. For more information about the network operational states exposed by systemd, see the `networkctl` manpage (`man networkctl`).
- ```json``` - A JSON encoding of this program's interpretation of `networkctl status "$IFACE"`, when the event is one for which such information is available; for debug logs or inspection with JSON-aware tools such as `jq`. Exact structure details are implementation-defined and liable to change.
- `json` - A JSON encoding of this program's interpretation of `networkctl status "$IFACE"`, when the event is one for which such information is available; for debug logs or inspection with JSON-aware tools such as `jq`. Exact structure details are implementation-defined and liable to change.
*Note: For `IP_ADDRS` and `IP6_ADDRS`, the space-delimited string can be read into a BASH array like this:
```read -r -a ip_addrs <<<"$IP_ADDRS"```
`read -r -a ip_addrs <<<"$IP_ADDRS"`
### Command-Line Options
......@@ -111,7 +111,7 @@ Copy networkd-dispatcher to /usr/bin.
Create the appropriate directory structure:
```$ sudo mkdir -p /etc/networkd-dispatcher/{routable,dormant,no-carrier,off,carrier,degraded,configuring,configured}.d```
`$ sudo mkdir -p /etc/networkd-dispatcher/{routable,dormant,no-carrier,off,carrier,degraded,configuring,configured}.d`
Install networkd-dispatcher.conf to /etc/conf.d.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment