-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make command "showip" print the IP address of the NIC defined in atalkd.conf #58
Comments
We're going to need to make that more robust anyway since my ethernet interface is named Additionally, the output of ifconfig has changed. That's going to cause problems too. And since the interface has changed, that's going to cause problems for netatalk too. First, let's see if we can determine the default route's device:
Now let's see if we can get a more useful output than the current ifconfig using that:
One could theoretically write something a little fancier that would include the IPv6 address (for both of the people out there who care about that) and use the route command above to extract just the default (eno1 in my case) interface. I think I like this more because it allows you to configure your network however you want and have Better still would be to configure netatalk to listen to all interfaces by default--but that's a separate consideration. Edit: Split terminal commands up for legibility. |
Thanks for that! I've written a guide on how to build a NAS around a Banana Pi (as it has a SATA port) running A2SERVER. I've implemented your entries in that guide: http://www.emaculation.com/doku.php/appletalk_printserver_macos_and_osx#install_a2server Also, to change eth0 to the default interface in atalkd.conf, I'm using this: And – off topic – the guide also includes installing a PAP backend (with CUPS) for those still having a functioning LaserWriter that only speaks AppleTalk (like my LW 4/600 PS). |
I figured that I had missed an important step from http://ivanx.com/a2server/a2server_installubuntu.html: I'm on an Ubuntu system and was supposed to amend the path variable to the executables: So, sorry for what I wrote in my initial post:
Just "ifconfig" is fine. |
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.
The text was updated successfully, but these errors were encountered: