瀏覽代碼

tune mountremote function

Kevin Heinicke 8 年之前
父節點
當前提交
93aa2d917e
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      zshrc

+ 4 - 2
zshrc

@@ -36,13 +36,15 @@ printable-code()
 
 # mount a remote's ($1) host dir ($2) at /MountPoint/$1
 mountremote () {
+  # set the root mount dir
+  mountroot="${3:-$HOME/mounts}";
   if [ -z "$2" ]; then
       mountpoint=$1-home
   else
       mountpoint=$1-`echo $2 | sed -E "s/\///g"`
   fi
-  mkdir -p /MountPoints/$mountpoint
-  sshfs $1:$2 "/MountPoints/$mountpoint" -o auto_cache,reconnect,volname=$mountpoint,no_readahead,noappledouble,nolocalcaches
+  mkdir -p $mountroot
+  sshfs $1:$2 "$mountroot/$mountpoint" -o auto_cache,reconnect,volname=$mountpoint,no_readahead,noappledouble,nolocalcaches
 }
 
 # use the symlinked ssh-auth-sock if available