Created
August 20, 2020 08:55
-
-
Save azharimad/11cbe05286a5cd5b6f03ec1677394227 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
chr_ver=6.45.9 | |
chr_file=chr-$chr_ver.img | |
disk=/dev/vda | |
disk_size=$(parted $disk print | grep $disk | cut -d" " -f3) | |
echo "download CHR" | |
wget https://download.mikrotik.com/routeros/$chr_ver/$chr_file.zip && unzip $chr_file.zip && rm -f $chr_file.zip | |
echo "copy CHR image to $disk" | |
dd if=$chr_file of=$disk bs=1M | |
echo "resize $disk" | |
parted $disk resizepart 1 $disk_size | |
e2fsck -f -y ${disk}1 | |
resize2fs ${disk}1 | |
echo "check $disk" | |
parted $disk print | |
echo "done. please reboot the VM via Control Panel" | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment