Implement Command zcip
Objective
Have a command, zcip, which does the following
help page
BusyBox v1.24.1 (2016-02-19 11:20:55 SGT) multi-call binary.
Usage: zcip [OPTIONS] IFACE SCRIPT
Manage a ZeroConf IPv4 link-local address
-f Run in foreground
-q Quit after obtaining address
-r 169.254.x.x Request this address first
-l x.x.0.0 Use this range instead of 169.254
-v Verbose
$LOGGING=none Suppress logging $LOGGING=syslog Log to syslog
With no -q, runs continuously monitoring for ARP conflicts, exits only on I/O errors (link down etc)
Done
- When the command complies with the above interface
- When it can be compiled as an applet into the slimbox binary
Demo
Show each command as an 'applet', and that it conforms to the interface:
$ slimbox zcip --help
BusyBox v1.24.1 (2016-02-19 11:20:55 SGT) multi-call binary.
Usage: zcip [OPTIONS] IFACE SCRIPT
...
Show that when called as a symlink, the same happens
$ ln -s slimbox zcip
$ ./zcip --help
BusyBox v1.24.1 (2016-02-19 11:20:55 SGT) multi-call binary.
Usage: zcip [OPTIONS] IFACE SCRIPT
...