]> gitweb.pimeys.fr Git - scripts-20-100.git/blob - ftp/bind_ftp_zeldren.sh
typo
[scripts-20-100.git] / ftp / bind_ftp_zeldren.sh
1 #!/bin/bash
2
3 # Pour monter les dossiers FTP
4 # Parce que les symlinks, ça ne me suffisait plus.
5
6 mountt(){
7 # Crée $2,
8 # puis binde $1 sur $2, sauf s'il y a déjà quelque chose de monté sur $2
9 mkdir -p "$2"
10 if mountpoint "$2" >/dev/null; then
11 return;
12 else
13 mount -o bind "$1" "$2"
14 fi;
15 }
16
17 DIR=/home/ftp
18
19 # Contenu de knebworth
20 DIRk=${DIR}/knebworth
21 mountt /media/Theta/Logiciels/ ${DIRk}/Logiciels/
22 mountt /media/Theta/Musiques/ ${DIRk}/Musiques/
23
24 mountt /media/Theta/Nanars/ ${DIRk}/Videos/Nanars/
25 mountt /media/Iota/Series ${DIRk}/Videos/Series
26 mountt /media/Theta/Concerts/ ${DIRk}/Videos/Concerts
27 mountt /media/Theta/Cineclub/ ${DIRk}/Videos/Cineclub
28 mountt /media/Theta/Animes/ ${DIRk}/Videos/Animes
29
30 # Contenu ajouté par 20-100
31 mountt /media/Alpha/Porn/ ${DIR}/Porn/
32 mountt /media/Alpha/MP3/ ${DIR}/MP3/
33 mountt /media/Alpha/Books/ ${DIR}/Books/
34 mountt /media/Omega/Vidéos/ ${DIR}/Vidéos
35 mountt /media/Kappa/Films/ ${DIR}/Films/
36 mountt /media/Theta/Jeux/ ${DIR}/Jeux/
37
38 export -f mountt
39 for seriesdir in /media/Omega/Séries/ /media/Kappa/Séries
40 do
41 find ${seriesdir} -mindepth 1 -maxdepth 1 \( -type d -or -type l \) \
42 -exec bash -c 's=$(basename "$0"); mountt "$0" "/home/ftp/Séries/${s}"' {} \;
43 done
44
45 # Dossier d'upload
46 mountt /media/Kappa/Upload/ ${DIR}/Upload/