浏览代码

init_homepath adapted to new folder structure

84582af
Dirk Alders 3 年前
父节点
当前提交
7d7a8bbdc2
共有 1 个文件被更改,包括 20 次插入7 次删除
  1. 20
    7
      init_homepath

+ 20
- 7
init_homepath 查看文件

@@ -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

正在加载...
取消
保存