summaryrefslogtreecommitdiffstats
path: root/ssh-mount.sh
blob: 1b216ecfa20e6e8f30dd5d384e3c2f0489f8ecea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
#----------------------------------------------------
# Version:      0.1.0
# Author:       Florian "Bluewind" Pritz <f-p@gmx.at>
#
# Copyright (C) 2008-2009 Florian Pritz
#
# Licensed under GNU General Public License v3
#   (see COPYING for full license text)
#
#----------------------------------------------------
# Easier mount remote folders over ssh
#----------------------------------------------------
if [ "$1" = "" ] || [ "$1" = "-h" ]; then 
 echo -e "${blue}Usage:$NC ssh-mount <server>";
 echo -e "${green}Servers:$NC wf, nevera-web, nevera-flo, df";
 exit 1
else
	case $1 in
		nevera-flo)
      DIR="/mnt/nevera/flo"
      mkdir -p "${DIR}"
			sshfs flo@nevera: -o reconnect -p 22222 "${DIR}" &&
			echo -e "${GREEN}Nevera: /home/flo mounted.$NC"
		;;
    nevera-web)
      DIR="/mnt/nevera/web"
      mkdir -p "${DIR}"
			sshfs web0@nevera: -o reconnect -p 22222 "${DIR}" &&
			echo -e "${GREEN}Nevera: web mounted.$NC"
		;;
    df)
      DIR="/mnt/df_ssh"
      mkdir -p "${DIR}"
			sshfs 105012-ftp@seitznet2.at: -p 22 "${DIR}" &&
			echo -e "${GREEN}DF mounted.$NC"
		;;
		wf)
      DIR="/mnt/wf_ssh"
      mkdir -p "${DIR}"
			sshfs stem47@stem47.loomes.net: -o reconnect -p 22 "${DIR}" &&
			echo -e "${GREEN}WF mounted.$NC"
		;;
		*)           echo -e "${RED}Error:$NC Unknown Server" ;;
	esac
 
fi