Sfoglia il codice sorgente

init_homepath adapted to new folder structure

84582af
Dirk Alders 3 anni fa
parent
commit
7d7a8bbdc2
1 ha cambiato i file con 20 aggiunte e 7 eliminazioni
  1. 20
    7
      init_homepath

+ 20
- 7
init_homepath Vedi File

@@ -1,13 +1,26 @@
1 1
 #!/bin/sh
2 2
 #
3 3
 
4
-rm -f $HOME/data; ln -s /user_data/data/$USER $HOME/data
5
-
6
-for folder in Bilder Dokumente eclipse Musik prj Schreibtisch; do
7
-    rm -rf $HOME/$folder; ln -s /user_data/data/$USER/$folder $HOME
8
-done
4
+REPLACE_FOLDERS="Audio Bilder data Dokumente Downloads eclipse Musik prj Schreibtisch Videos"
9 5
 
10 6
 
11
-for folder in Audio Downloads Videos; do
12
-    rm -rf $HOME/$folder; ln -s /user_data/static_data/$USER/$folder $HOME
7
+echo The following folders will be deleted:
8
+for folder in $REPLACE_FOLDERS; do
9
+	echo "* $HOME/\033[1m$folder\033[0m"
13 10
 done
11
+echo
12
+read -r -p "Are you sure? [y/N] " response
13
+case "$response" in
14
+    [yY][eE][sS]|[yY]) 
15
+        for folder in $REPLACE_FOLDERS; do
16
+            if [ "$folder" = "data" ]; then
17
+                rm -f $HOME/data; ln -s /usr/data/$USER $HOME/data
18
+            else
19
+                rm -rf $HOME/$folder; ln -s /usr/data/$USER/$folder $HOME
20
+            fi
21
+        done
22
+        ;;
23
+    *)
24
+        echo No folder initialisation!
25
+        ;;
26
+esac

Loading…
Annulla
Salva