3 # Copyright (c) 2007-2008 by Marc Feeley, All Rights Reserved.
7 # This shell program is very platform specific. It will be hard to
8 # get working on another development machine. The shell program's
9 # argument is a script which is transferred to a MacOS X workstation
10 # and executed there. The output from this shell is then transferred
11 # back. All transfers are done with scp, which is setup to not
14 rm -f /tmp
/_macosx-rsh
*
15 cp "$1" /tmp
/_macosx-rsh-script
19 for intf
in en1 en0
; do #for intf in `ifconfig -l -u`; do
20 intf_ip_addr
=`ifconfig $intf | sed -e "s/.*inet [^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/p" -e "d"`
21 if test "$intf_ip_addr" != "" -a "$intf_ip_addr" != "127.0.0.1"; then
22 self_ip_addr
="$intf_ip_addr"
26 ORIGINATOR_IP
="$self_ip_addr"
28 #ORIGINATOR_HN="`hostname`"
29 #ORIGINATOR_IP="`dig +tries=2 +time=2 +short $ORIGINATOR_HN`"
30 #if [ "$?" != "0" -o "$ORIGINATOR_IP" == "" ] ; then
31 # ORIGINATOR_IP="192.168.0.5" # Usual static IP address of development machine
34 ORIGINATOR
="`id -nu`@$ORIGINATOR_IP"
36 ssh localhost
"/bin/sh --login -c \"export ORIGINATOR=$ORIGINATOR;rm -rf /tmp/macosx-rsh*;scp $ORIGINATOR:/tmp/_macosx-rsh-script /tmp/macosx-rsh-script;chmod +x /tmp/macosx-rsh-script;/tmp/macosx-rsh-script < /dev/null > /tmp/macosx-rsh-script.out 2>&1;scp /tmp/macosx-rsh-script.out $ORIGINATOR:/tmp/_macosx-rsh-script.out;rm -rf /tmp/macosx-rsh*\""
38 if [ -e /tmp
/_macosx-rsh-script.out
] ; then
39 cat /tmp
/_macosx-rsh-script.out
42 rm -f /tmp
/_macosx-rsh
*