Home Forums Software InstaDMG Enabling AppleTalk

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #371073
    Patrick Fergus
    Participant

    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.

    #371077
    Greg Neagle
    Participant

    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][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]

    #371083
    Patrick 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

    #371084
    Patrick 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

    #372446
    pteeter
    Participant

    I 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/sh

    PATH=/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 $launchdaemon

    exit 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 lpadmin

    If #2 can be done without explicitly doing #1, fine.

    What’s ‘best practice’ persay?

    #372448
    Patrick 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 assigned

    This 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 lpadmin

    I 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

    #372451
    pteeter
    Participant

    I 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.

    #372452
    Patrick 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

    #372453
    pteeter
    Participant

    Yeah, 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.

    #372489
    pteeter
    Participant

    Went 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.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.

Comments are closed