|
FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
You can replace
Code:
# Create mount point if necessary if [ ! -e "$MOUNT_PT" ] then mkdir "$MOUNT_PT" fi Code:
mkdir -p ${MOUNT_PT} Code:
# Mount /home/ninjasb@starbox via sshfs echo $0 Testing connection type for local or ext ... if ifconfig | grep "$LOCAL_IP_TEST" > /dev/null ; then echo $0: Using local IP address: ${LOCAL_IP} IP=${LOCAL_IP} else echo $0: Using external IP address : ${EXT_IP} IP=${EXT_IP} fi echo $0 : mounting in progress .... sshfs ninjasb@"${IP}":/home/ninjasb "$MOUNT_PT" -oreconnect,volname=starbox_ninjasb
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
||||
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
__________________
Kill your t.v. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Crontab won't run script | Petrocelli08 | FreeBSD General | 4 | 7th March 2009 04:19 AM |
Backup script(s)? | giddyupman | General software and network | 2 | 3rd January 2009 02:06 PM |
Handy X11 script | Gabe_G23 | Guides | 6 | 25th October 2008 05:08 PM |
my 1st sh script | graudeejs | Programming | 12 | 18th August 2008 10:25 PM |
Shell Script. | bsdnewbie999 | Programming | 21 | 15th July 2008 07:54 AM |