forked from on-prem/tinycore-symlinktool
/
tc-restore.sh.patch
38 lines (36 loc) · 906 Bytes
/
tc-restore.sh.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
diff --git a/etc/init.d/tc-restore.sh b/etc/init.d/tc-restore.sh
index 7a7b7cd..b20e194 100755
--- a/etc/init.d/tc-restore.sh
+++ b/etc/init.d/tc-restore.sh
@@ -24,6 +24,7 @@ for i in `cat /proc/cmdline`; do
case $i in
restore) RESTORE=1 ;;
protect) PROTECT=1 ;;
+ symlinksrestore) SYMLINKSRESTORE=1 ;;
esac
;;
esac
@@ -38,7 +39,11 @@ if [ -n "$PROTECT" ]; then
DEVICE=`autoscan "$MYDATA".tgz.bfe 'f'`
fi
if [ -n "$DEVICE" ]; then
- /usr/bin/filetool.sh -r "$DEVICE"
+ if [ -n "$SYMLINKSRESTORE" ]; then
+ /usr/bin/symlinktool.sh -r "$DEVICE"
+ else
+ /usr/bin/filetool.sh -r "$DEVICE"
+ fi
exit 0
fi
fi
@@ -57,7 +62,11 @@ if [ -z "$DEVICE" ]; then
fi
if [ -n "$DEVICE" ]; then
- /usr/bin/filetool.sh -r "$DEVICE"
+ if [ -n "$SYMLINKSRESTORE" ]; then
+ /usr/bin/symlinktool.sh -r "$DEVICE"
+ else
+ /usr/bin/filetool.sh -r "$DEVICE"
+ fi
exit 0
fi