]> gitweb.pimeys.fr Git - scripts-20-100.git/blobdiff - ftp/bind_ftp_zeldren.sh
Renommage pour séparation cabal/zeldren
[scripts-20-100.git] / ftp / bind_ftp_zeldren.sh
diff --git a/ftp/bind_ftp_zeldren.sh b/ftp/bind_ftp_zeldren.sh
new file mode 100755 (executable)
index 0000000..ba30d36
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+# Pour monter les dossiers FTP
+# Parce que les symlinks, ça ne me suffisait plus.
+
+mountt(){
+    # Crée $2,
+    # puis inde $1 sur $2, sauf s'il y a déjà quelque chose de monté sur $2
+    mkdir -p "$2"
+    if mountpoint "$2" >/dev/null; then
+        return;
+    else
+        mount -o bind "$1" "$2"
+    fi;
+}
+
+DIR=/home/ftp
+
+# Contenu de knebworth
+DIRk=${DIR}/knebworth
+mountt /media/Theta/Logiciels/ ${DIRk}/Logiciels/
+mountt /media/Theta/Musiques/ ${DIRk}/Musiques/
+
+mountt /media/Theta/Nanars/ ${DIRk}/Videos/Nanars/
+mountt /media/Iota/Series ${DIRk}/Videos/Series
+mountt /media/Theta/Concerts/ ${DIRk}/Videos/Concerts
+mountt /media/Theta/Cineclub/ ${DIRk}/Videos/Cineclub
+mountt /media/Theta/Animes/ ${DIRk}/Videos/Animes
+
+# Contenu ajouté par 20-100
+mountt /media/Alpha/Porn/ ${DIR}/Porn/
+mountt /media/Alpha/MP3/ ${DIR}/MP3/
+mountt /media/Alpha/Books/ ${DIR}/Books/
+mountt /media/Omega/Vidéos/ ${DIR}/Vidéos
+mountt /media/Kappa/Films/ ${DIR}/Films/
+mountt /media/Theta/Jeux/ ${DIR}/Jeux/
+
+export -f mountt
+for seriesdir in /media/Omega/Séries/ /media/Kappa/Séries
+do
+    find ${seriesdir} -mindepth 1 -maxdepth 1 \( -type d -or -type l \) \
+-exec bash -c 's=$(basename "$0"); mountt "$0" "/home/ftp/Séries/${s}"' {} \;
+done