Last active
December 14, 2015 04:49
-
-
Save takuya-i/5031075 to your computer and use it in GitHub Desktop.
AU光の契約で配られているルータが、ローカルLANからグローバルIP指定し、サーバアクセスすると、
接続できないんで、それを判別し、ssgfsで自動マウントするスクリプト。(OSX 専用 )
サーバあるんだったら、DNS立てろというのはなしはなしで.....
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# check Home Local LAN or other place, wifi or company office | |
# if access from home LAN, out Home LAN IP address, otherwise return global IP addrress | |
# Author Takuya Inoue | |
#GROBAL IP address | |
IP_ADDR=xxx.xxx.xxx.xxx | |
# network is 192.168.0.0/24 | |
if [ `uname` = "Darwin" ] && [ -n "`ifconfig -a |awk '/192.168.0.*/ {print $2}'`" ] ; then | |
IP_ADDR="192.168.0.10" # Server IP at home LAN. | |
fi | |
MOUNT_DIR=~/Desktop/mntsshfs | |
if [ ! -d $MOUNT_DIR ] | |
then | |
mkdir $MOUNT_DIR | |
fi | |
sshfs -p 22 admin@${IP_ADDR}:/data ~/Desktop/mntsshfs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment