A small C program that runs a script if no address is given to an interface after enough time has elapsed.
- Install grab a pre-build binary or build from source
- Install that file to
/usr/local/bin/netreactd
chown root:root /usr/local/bin/netreactd
chmod 0755 /usr/local/bin/netreactd
- Create a new file at
/etc/systemd/system/netreactd-lidar.service
- Add the following contents:
[Unit]
Description=Monitor connections on eth0 and setup a static IP to Lidar when DHCP doesn't kick in
Before=network-pre.target
Wants=network-pre.target
[Service]
Type=simple
Restart=always
RestartSec=2s
Environment=NETREACT_IF=eth0
Environment=NETREACT_TIMEOUT=4
Environment=NEWLINK_SCRIPT='/abs/path/to/toNewLinkScript'
Environment=NETREACT_UP_SCRIPT='/abs/path/to/toUpScript'
Environment=NETREACT_DOWN_SCRIPT='/abs/path/to/toDownScript'
Environment=SKIP_FIRST_NEW_ADDRESS='1'
ExecStart=/usr/local/bin/netreactd
[Install]
WantedBy=network.target
- Clone the repository
- make