Skip to content

Instantly share code, notes, and snippets.

@geek-id
Last active March 16, 2021 22:31
Show Gist options
  • Save geek-id/e3f539fc3b8306cfcd9ec6945b3c0a29 to your computer and use it in GitHub Desktop.
Save geek-id/e3f539fc3b8306cfcd9ec6945b3c0a29 to your computer and use it in GitHub Desktop.

Revisions

  1. geek-id revised this gist Jul 29, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mikrotik-chr.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    wget https://download2.mikrotik.com/routeros/6.38.3/chr-6.38.3.img.zip -O chr.img.zip && \
    gunzip -c chr.img.zip > chr.img && \
    mount -o loop,offset=33554944 chr.img /mnt && \
    ADDRESS=`ip addr show ens3 | grep global | cut -d' ' -f 6 | head -n 1` && \
    ADDRESS=`ip addr show eth0 | grep global | cut -d' ' -f 6 | head -n 1` && \
    GATEWAY=`ip route list | grep default | cut -d' ' -f 3` && \
    echo "/ip address add address=$ADDRESS interface=[/interface ethernet find where name=ether1]
    /ip route add gateway=$GATEWAY
  2. geek-id revised this gist Jul 29, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions mikrotik-chr.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    wget https://download.mikrotik.com/routeros/6.45.9/chr-6.45.9.img.zip -O chr.img.zip && \
    wget https://download2.mikrotik.com/routeros/6.38.3/chr-6.38.3.img.zip -O chr.img.zip && \
    gunzip -c chr.img.zip > chr.img && \
    mount -o loop,offset=33554944 chr.img /mnt && \
    ADDRESS=`ip addr show eth0 | grep global | cut -d' ' -f 6 | head -n 1` && \
    ADDRESS=`ip addr show ens3 | grep global | cut -d' ' -f 6 | head -n 1` && \
    GATEWAY=`ip route list | grep default | cut -d' ' -f 3` && \
    echo "/ip address add address=$ADDRESS interface=[/interface ethernet find where name=ether1]
    /ip route add gateway=$GATEWAY
  3. geek-id revised this gist Jul 29, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mikrotik-chr.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    wget https://download.mikrotik.com/routeros/6.47.1/chr-6.47.1.img.zip -O chr.img.zip && \
    wget https://download.mikrotik.com/routeros/6.45.9/chr-6.45.9.img.zip -O chr.img.zip && \
    gunzip -c chr.img.zip > chr.img && \
    mount -o loop,offset=33554944 chr.img /mnt && \
    ADDRESS=`ip addr show eth0 | grep global | cut -d' ' -f 6 | head -n 1` && \
  4. geek-id created this gist Jul 29, 2020.
    11 changes: 11 additions & 0 deletions mikrotik-chr.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    wget https://download.mikrotik.com/routeros/6.47.1/chr-6.47.1.img.zip -O chr.img.zip && \
    gunzip -c chr.img.zip > chr.img && \
    mount -o loop,offset=33554944 chr.img /mnt && \
    ADDRESS=`ip addr show eth0 | grep global | cut -d' ' -f 6 | head -n 1` && \
    GATEWAY=`ip route list | grep default | cut -d' ' -f 3` && \
    echo "/ip address add address=$ADDRESS interface=[/interface ethernet find where name=ether1]
    /ip route add gateway=$GATEWAY
    " > /mnt/rw/autorun.scr && \
    umount /mnt && \
    echo u > /proc/sysrq-trigger && \
    dd if=chr.img bs=1024 of=/dev/vda