Xu Xiaodong avatar Xu Xiaodong committed aca9697

fix bug

Comments (0)

Files changed (7)

 # modified:     2011 Aug 14
 #
 
+#-- 配置目标盘 --#
+# 硬盘
+HDD=/dev/sda
+# 优盘
+UFD=/dev/sdc
+
+#-- 所需程序路径 --#
 BASE="$HOME"/tools
 PROG="$BASE"/ucloner/program
 SH="$BASE"/resbox
+
+#-- 镜像名称 --#
 IMAGE="$BASE"/ucloner/ubox.squashfs
 NAME=$(date +%Y-%m-%d)
 
+#-- 选项 --#
 ACTION="$1"
 TYPE="$2"
 
       fi
       "$SH"/part_"$TYPE".sh > /dev/null 2>&1
       sudo ./ucloner_cmd.py mode=restore restore_from="$IMAGE" \
-        /=/dev/sda1 /_fs=ext4 \
-        /tmp=/dev/sda2 /tmp_fs=ext4 \
-        /var=/dev/sda3 /var_fs=ext4 \
-        /home=/dev/sda5 /home_fs=ext4 \
-        swap=/dev/sda6 \
-        grubdev=/dev/sda
+        /="$HDD"1 /_fs=ext4 \
+        /tmp="$HDD"2 /tmp_fs=ext4 \
+        /var="$HDD"3 /var_fs=ext4 \
+        /home="$HDD"5 /home_fs=ext4 \
+        swap="$HDD"6 \
+        grubdev="$HDD"
     else
       echo "请安装硬盘先."
       exit 1
     ;;
   clone)
     sudo ./ucloner_cmd.py mode=clone \
-      /=/dev/sda1 /_fs=ext4 \
-      /tmp=/dev/sda2 /tmp_fs=ext4 \
-      /var=/dev/sda3 /var_fs=ext4 \
-      /home=/dev/sda5 /home_fs=ext4 \
-      swap=/dev/sda6 \
-      grubdev=/dev/sda \
+      /="$HDD"1 /_fs=ext4 \
+      /tmp="$HDD"2 /tmp_fs=ext4 \
+      /var="$HDD"3 /var_fs=ext4 \
+      /home="$HDD"5 /home_fs=ext4 \
+      swap="$HDD"6 \
+      grubdev="$HDD" \
       exclude=/home/ubox/ucloner
     ;;
   udisk)
     "$SH"/part_ufd.sh > /dev/null 2>&1
     sudo ./ucloner_cmd.py mode=restore restore_from="$IMAGE" \
-      /=/dev/sdc1 /_fs=ext4 \
-      grubdev=/dev/sdc
+      /="$UFD"1 /_fs=ext4 \
+      grubdev="$UFD"
     ;;
   *)
     usage
 
 PROG="$HOME"/tools/resbox
 
-if [ -d "$PORG" ]; then
+if [ -d $PORG ]; then
   cd "$PROG"
   ./resbox backup
 else
 
 PROG="$HOME"/tools/resbox
 
-if [ -d "$PORG" ]; then
+if [ -d $PORG ]; then
   cd "$PROG"
   ./resbox clone
 else
 
 PROG="$HOME"/tools/resbox
 
-if [ -d "$PORG" ]; then
+if [ -d $PORG ]; then
   cd "$PROG"
   ./resbox restore hdd
 else
 
 PROG="$HOME"/tools/resbox
 
-if [ -d "$PROG" ]; then
+if [ -d $PROG ]; then
   cd "$PROG"
   ./resbox restore ssd
 else
 
 PROG="$HOME"/tools/resbox
 
-if [ -d "$PORG" ]; then
+if [ -d $PORG ]; then
   cd "$PROG"
   ./resbox restore ssd16
 else
 
 PROG="$HOME"/tools/resbox
 
-if [ -d "$PORG" ]; then
+if [ -d $PORG ]; then
   cd "$PROG"
   ./resbox udisk
 else
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.