Skip to content

Instantly share code, notes, and snippets.

View PavelAlves's full-sized avatar

Pavel PavelAlves

  • Liciteiro.com
View GitHub Profile
@PavelAlves
PavelAlves / make-chr.sh
Last active March 12, 2026 22:09 — forked from zztopper/make-chr.sh
Install Mikrotik CHR on generic KVM/VMWare virtual machine
#!/bin/bash
#Setting variables
PARTITION=`mount | grep 'on / type' | cut -d" " -f1`
DISK=${PARTITION::-1}
echo "Disk: $DISK"
ADDRESS=`ip -4 addr show eth0 | grep global | cut -d' ' -f 6 | head -n 1`
echo "IPv4 address: $ADDRESS\n"
GATEWAY=`ip -4 route list | grep default | cut -d' ' -f 3`
echo "IPv4 gateway: $GATEWAY\n"
ADDRESS6=`ip -6 addr show eth0 | grep global | grep inet6 | cut -d' ' -f 6 | head -n 1`