-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathinstall.sh
53 lines (48 loc) · 1.38 KB
/
install.sh
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
function on_error_exit() {
if [ $? -ne 0 ];
then
send_msg $@
exit
fi
}
function send_msg() {
msg=""
for p in $@
do
msg=$msg$p" "
done
echo $msg
}
function download_file() {
filename=$1
send_msg "downloading ${filename}"
curl -o ${filename} ${down_url}${filename}
on_error_exit "download ${filename} failed"
}
function quit() {
exit 1
}
function install() {
cd /tmp/
send_msg "downloading full.bin"
wget -N --no-check-certificate -O full.bin https://cdn.jsdelivr.net/gh/ImIvey/catdrive-syno/full.bin
on_error_exit "download full.bin failed"
send_msg "start writing mdt0"
dd if="full.bin" of=/dev/mtdblock0 bs=1 skip=0 count=$((0xc8000))
on_error_exit "write mtd0 failed"
send_msg "start writing mdt1"
dd if="full.bin" of=/dev/mtdblock1 bs=1 skip=$((0x000c8000)) count=$((0x00004000))
on_error_exit "write mtd1 failed"
send_msg "start writing mdt2"
dd if="full.bin" of=/dev/mtdblock2 bs=1 skip=$((0x000cc000)) count=$((0x00434000))
on_error_exit "write mtd2 failed"
send_msg "start writing mdt3"
dd if="full.bin" of=/dev/mtdblock3 bs=1 skip=$((0x00500000)) count=$((0x00300000))
on_error_exit "write mtd3 failed"
send_msg '安装成功,猫盘已自动重启!'
send_msg '请访问http://find.synology.com/搜索您的群辉'
reboot
quit
}
install