代码拉取完成,页面将自动刷新
#!/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://gitee.com/sharkor/catdrive-syno/raw/master/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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。