mirror of
https://huihui.cat/mirrors/MikroTikPatch.git
synced 2026-01-28 01:07:18 +01:00
Update chr.sh
Signed-off-by: elseif <elseif@live.cn>
This commit is contained in:
parent
c40954115b
commit
36be15859e
1 changed files with 8 additions and 9 deletions
17
chr.sh
17
chr.sh
|
|
@ -40,15 +40,6 @@ DNS=$(grep '^nameserver' /etc/resolv.conf | awk '{print $2}' | head -n 1)
|
|||
[ -z "$DNS" ] && DNS="8.8.8.8"
|
||||
echo "DNS: $DNS"
|
||||
|
||||
|
||||
echo "WARNING: All data on /dev/$STORAGE will be lost!"
|
||||
read -p "Do you want to continue? [Y/n]: " confirm < /dev/tty
|
||||
confirm=${confirm:-Y}
|
||||
if [[ "$confirm" =~ ^[Nn]$ ]]; then
|
||||
echo "Operation aborted."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "FILE: $(basename $IMG_URL)"
|
||||
if command -v wget >/dev/null 2>&1; then
|
||||
wget --no-check-certificate -O /tmp/chr.img.zip "$IMG_URL" || { echo "Download failed!"; exit 1; }
|
||||
|
|
@ -78,6 +69,14 @@ EOF
|
|||
losetup -d $LOOP
|
||||
fi
|
||||
|
||||
echo "WARNING: All data on /dev/$STORAGE will be lost!"
|
||||
read -p "Do you want to continue? [Y/n]: " confirm < /dev/tty
|
||||
confirm=${confirm:-Y}
|
||||
if [[ "$confirm" =~ ^[Nn]$ ]]; then
|
||||
echo "Operation aborted."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dd if=chr.img of=/dev/$STORAGE bs=4M conv=fsync
|
||||
echo "Ok, rebooting..."
|
||||
echo 1 > /proc/sys/kernel/sysrq 2>/dev/null || true
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue