mirror of
https://github.com/elseif/MikroTikPatch
synced 2026-07-17 10:39:40 +00:00
modified: chr.sh
This commit is contained in:
parent
3bde30196c
commit
497ed531f3
5
chr.sh
5
chr.sh
@ -138,7 +138,7 @@ show_system_info() {
|
|||||||
echo "$MSG_BOOTMODE $BOOT_MODE"
|
echo "$MSG_BOOTMODE $BOOT_MODE"
|
||||||
}
|
}
|
||||||
|
|
||||||
confirm_storge() {
|
confirm_storage() {
|
||||||
STORAGE=$(lsblk | grep disk | head -1 | awk '{print $1}')
|
STORAGE=$(lsblk | grep disk | head -1 | awk '{print $1}')
|
||||||
ask_until "$MSG_STORAGE_DEVICE" "$STORAGE"
|
ask_until "$MSG_STORAGE_DEVICE" "$STORAGE"
|
||||||
STORAGE=$resp
|
STORAGE=$resp
|
||||||
@ -321,13 +321,14 @@ EOF
|
|||||||
|
|
||||||
|
|
||||||
write_and_reboot() {
|
write_and_reboot() {
|
||||||
confirm_storge
|
confirm_storage
|
||||||
printf "$MSG_WARNING\n" "$STORAGE"
|
printf "$MSG_WARNING\n" "$STORAGE"
|
||||||
ask_yesno "$MSG_CONFIRM_CONTINUE"
|
ask_yesno "$MSG_CONFIRM_CONTINUE"
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "$MSG_OPERATION_ABORTED"
|
echo "$MSG_OPERATION_ABORTED"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
sync
|
||||||
dd if=chr.img of=/dev/$STORAGE bs=4M conv=fsync
|
dd if=chr.img of=/dev/$STORAGE bs=4M conv=fsync
|
||||||
echo "$MSG_REBOOTING"
|
echo "$MSG_REBOOTING"
|
||||||
echo 1 > /proc/sys/kernel/sysrq 2>/dev/null || true
|
echo 1 > /proc/sys/kernel/sysrq 2>/dev/null || true
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user