- This topic has 10 replies, 4 voices, and was last updated 16 years, 11 months ago by
pteeter.
-
AuthorPosts
-
January 10, 2008 at 11:30 pm #371073
Patrick Fergus
ParticipantHow would I enable AppleTalk on the Ethernet port in InstaDMG? Currently I have a script being kicked off by a StartupItem that tries the following upon first boot of a freshly imaged machine:
[code]appletalk -q -u en0[/code]
Which does work when run after the machine starts up. However, trying to make AppleTalk join to en0 before OS X is completely booted is likely a problem.
January 11, 2008 at 12:15 am #371077Greg Neagle
ParticipantI’d recommend using the networksetup utility:
networksetup -setappletalk “Built-in Ethernet” on
Note that you’ll actually want to query the available network interfaces — Mac Pros have two Built-in Ethernet ports, “Built-in Ethernet 1” and “Built-in Ethernet 2”
-Greg
[QUOTE][u]Quote by: Patrick+Fergus[/u][p]How would I enable AppleTalk on the Ethernet port in InstaDMG? Currently I have a script being kicked off by a StartupItem that tries the following upon first boot of a freshly imaged machine:
[code]appletalk -q -u en0[/code]
Which does work when run after the machine starts up. However, trying to make AppleTalk join to en0 before OS X is completely booted is likely a problem.[/p][/QUOTE]
January 11, 2008 at 4:46 am #371083Patrick Fergus
Participant[QUOTE][u]Quote by: gneagle[/u][p]I’d recommend using the networksetup utility:
networksetup -setappletalk “Built-in Ethernet” on
Note that you’ll actually want to query the available network interfaces — Mac Pros have two Built-in Ethernet ports, “Built-in Ethernet 1” and “Built-in Ethernet 2”
-Greg[/QUOTE]
Sounds good to me!
Thanks,
– Patrick
January 11, 2008 at 4:48 am #371084Patrick Fergus
Participant[QUOTE][u]Quote by: MacTroll[/u][p]What are you using AT for?
If just for printing, it auto-enables when you need it.[/p][/QUOTE]
We’re just using it for wired AppleTalk printing. Unfortunately, our users aren’t administrators and can’t authenticate to turn it on.
Thanks,
– Patrick
April 25, 2008 at 6:15 pm #372446pteeter
ParticipantI am also trying to get this working.
I’d like to enable AppleTalk for a wired (ethernet) interface that has an IP assigned.
This shell script works on a booted system:
[code]
#!/bin/shPATH=/bin:/sbin:/usr/sbin:/usr/bin:/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support
launchdaemon=”/Library/LaunchDaemons/com.companyname.enableAppleTalk.plist”### loop through all Ethernet network interfaces
for eth in “`networksetup -listallnetworkservices | grep Ethernet`”
do
#echo “$eth”
ip=`networksetup -getinfo “$eth” | grep ‘IP\ address’ | grep -v ‘IPv6’`
#echo “$ip”
### if Ethernet interface has IP assigned, enable AppleTalk on it
if [ “$ip” ]; then
networksetup -setappletalk “$eth” on
#networksetup -getappletalk “$eth”
fi
done### delete launchdaemon file after first boot
rm -rf $launchdaemonexit 0
[/code]Obviously, ignore the commented debugging lines and note that I’m trying to do this with a LaunchDaemon.
It appears that Leopard refers to wired network interfaces on things like MB, MBP, MM as simply ‘Ethernet’ and not ‘Built-in Ethernet’ as Tiger does.
I’m curious about Joel’s assertion that AppleTalk will enable automatically, for printing, if needed.
Here’s what I’d like to accomplish…
1. enable AppleTalk for ethernet interface that has IP assigned
2. configure printers, some over AppleTalk, with lpadminIf #2 can be done without explicitly doing #1, fine.
What’s ‘best practice’ persay?
April 25, 2008 at 8:52 pm #372448Patrick Fergus
Participant> I’m curious about Joel’s assertion that AppleTalk
> will enable automatically, for printing, if
> needed.I know this is true, at least for Panther. It was one of the first sources of complaints years ago when we were doing our first image. If AppleTalk isn’t on when you try to browse AppleTalk printers, it will silently be turned on if you’re an administrator or you’ll be prompted for a admin l/p if you’re not.
> Here’s what I’d like to accomplish…
>
> 1. enable AppleTalk for ethernet interface that
> has IP assignedThis works for us at startup time:
[code]#Enable AppleTalk
firstEthernet=`/usr/sbin/networksetup -listallnetworkservices | /usr/bin/grep -m 1 Ethernet`
/usr/sbin/networksetup -setappletalk “$firstEthernet” on[/code]>2. configure printers, some over
> AppleTalk, with lpadminI don’t think lpadmin cares if AppleTalk is running. It’s just writing out a configuration file. Are you asking how to format an lpadmin command correctly?
> If #2 can be done without explicitly doing #1,
> fine.I think it would work fine.
– Patrick
April 25, 2008 at 10:47 pm #372451pteeter
ParticipantI worry that the ‘grep -m 1 Ethernet’ will fail on machines that have only 1 ethernet port…in Leopard.
Nope, know how to write the lpadmin command.
I’ll try not enabling AppleTalk and configuring the printers.
We’ll see how it goes.
April 26, 2008 at 3:06 am #372452Patrick Fergus
Participant> I worry that the ‘grep -m 1 Ethernet’ will fail on machines that have only 1 ethernet port…in Leopard.
Checking the following on my dual 533 G4 running Leopard Server:
[code]bash-3.2# /usr/sbin/networksetup -listallnetworkservices
An asterisk (*) denotes that a network service is disabled.
Ethernet
*Internal Modem
*FireWire[/code]In this case, networksetup would be pointed at the “Ethernet” port. I’ve built MacBook Pros from our InstaDMG image and nobody has mentioned any printing issues.
The “-m [u]NUM[/u]” grep switch means to stop looking for matches after [u]NUM[/u] matching lines. Maybe you’re reading it as searching for Ethernet interface #1? IIRC, I [i]think[/i] a dual-Ethernet machine would have ports “Ethernet 1” and “Ethernet 2”. “Ethernet 1” appears first, grep grabs only that entry and it is passed to networksetup.
– Patrick
April 26, 2008 at 4:01 am #372453pteeter
ParticipantYeah, I don’t have a later PMG5 or MacPro handy with Leopard running to check.
Yup, rtfm on grep.
It’s been a ‘free day’ today due to Friday.
Good info either way.
April 29, 2008 at 3:16 am #372489pteeter
ParticipantWent with Patrick’s suggestion re. grep -m 1 Ethernet. Works great from Terminal and even as loginhook.
Cannot get it to work via Launch Daemon – Leopard, Tiger (PPC nor x86).
Looks like, in the interest of expediency, I’m going to enable AppleTalk via loginhook and be done with it.
-
AuthorPosts
- You must be logged in to reply to this topic.
Comments are closed