841c8663e9
Prior to this change, ndhc would fail to run with a malformed command error if the leasefile was empty since the -r parameter requires an argument. Note that this script requires execline 2.9.1.0 for the eltest program. For earlier versions of s6, it should be fine to use the POSIX test program instead.
9 lines
225 B
Plaintext
Executable File
9 lines
225 B
Plaintext
Executable File
#!/bin/execlineb -P
|
|
fdmove -c 2 1
|
|
backtick OLDEXTIP { cat /etc/ndhc/LEASE-wan0 }
|
|
importas OLDEXTIP OLDEXTIP
|
|
ifelse { eltest -n $OLDEXTIP }
|
|
{ /sbin/ndhc -c /etc/ndhc/wan0.conf -r $OLDEXTIP }
|
|
/sbin/ndhc -c /etc/ndhc/wan0.conf
|
|
|