View Single Post
  #3   (View Single Post)  
Old 24th October 2008
anomie's Avatar
anomie anomie is offline
Local
 
Join Date: Apr 2008
Location: Texas
Posts: 445
Lightbulb

I'd paint that bike shed like this:

Code:
#!/bin/sh

<init vars here> 

mount_it() {

  echo "Attempting to mount to ${1}..."

  # If connect scan to tcp 22 works, then mount
  ( nc -z -w 2 ${1} 22 >/dev/null ) && <sshfs mount ${1} here>

  # If that all worked, we get out
  if [ ${?} -eq 0 ] ; then
    echo 'Mounted.'
    exit 0
  fi

}

mount_it ${local_ip}
mount_it ${external_ip}

exit 0
netcat (nc) should be included with your Mac OSX base system.
__________________
Kill your t.v.
Reply With Quote