Denys Vlasenko | d32a1a4 | 2015-10-24 05:30:58 +0200 | [diff] [blame^] | 1 | #!/bin/sh |
| 2 | # convert: |
| 3 | |
| 4 | #interface=eth1 |
| 5 | #ip=169.254.x.y |
| 6 | |
| 7 | #let cfg=cfg+1 |
| 8 | #if[$cfg]=...; ip[$cfg]=...; ipmask[$cfg]=.../...; gw[$cfg]=...; net[$cfg]=... dns[$cfg]=... |
| 9 | |
| 10 | exec >/dev/null |
| 11 | #exec >"$0.out" # debug |
| 12 | exec 2>&1 |
| 13 | |
| 14 | test "$interface" || exit 1 |
| 15 | test "$ip" || exit 1 |
| 16 | |
| 17 | { |
| 18 | echo "let cfg=cfg+1" |
| 19 | test "$interface" && echo "if[\$cfg]='$interface'" |
| 20 | test "$ip" && echo "ip[\$cfg]='$ip'" |
| 21 | test "$ip" && echo "ipmask[\$cfg]='$ip/16'" |
| 22 | } >"$1" |