-
Notifications
You must be signed in to change notification settings - Fork 8
Description
In a2server/scripts/tools/a2server-aliases the command "showip" is defined as printing the IP address of eth0. However, if you define a different NIC for AppleTalk in atalkd.conf manually, you would want "showip" to print the IP address of that one (for example, the on-board NIC of the C.H.I.P. or Banana Pi are not able to transport AppleTalk, so one needs a USB-to-Ethernet adapter which will then be recognized as eth1).
I therefore suggest to have "showip" check atalkd.conf for its NIC first and then display the IP address of that NIC:
'/sbin/ifconfig $(cat /etc/netatalk/atalkd.conf | tail -n 5 | grep "eth" | cut -d" " -f1) | grep "inet\ addr" | cut -d: -f2 | cut -d" " -f1'
Same goes for command "showmac". I suggest to change it into:
'/sbin/ifconfig $(cat /etc/netatalk/atalkd.conf | tail -n 5 | grep "eth" | cut -d" " -f1) | grep "HWaddr" | cut -dH -f2 | cut -c7-23'
Also, it seems "ifconfig" as a command can't be used anymore. Instead it needs to be used with its path: "/sbin/ifconfig". Not sure whether that's the case (and correct path) for every system.
This is an issue with the "showip", "showmac", "showip-wifi", and "showmac-wifi" commands.