diff --git a/mikrotik-setup.sh b/mikrotik-setup.sh new file mode 100644 index 0000000..dbe2c4f --- /dev/null +++ b/mikrotik-setup.sh @@ -0,0 +1,45 @@ +#!/bin/sh +# Nico Schottelius, 2019-12-02 +# Setup standard mikrotik settings + + +if [ $# -lt 1 ]; then + echo "$0 [target]" + exit 1 +fi + +target=$1; shift + + +conf() { + echo $@ + ssh admin@${target} "$@" +} +copy() { + scp "$1" admin@${target}: +} + +# store ssh key in the admin user! +copy ~/.ssh/id_rsa.pub +conf "/user ssh-keys import user=admin public-key-file=id_rsa.pub" +conf "/file remove id_rsa.pub" + +# remove unecessary stuff +for unusedpkg in calea gps lora mpls openflow tr069-client ups \ + advanced-tools hotspot ntp; do + conf "/system package uninstall $unusedpkg" +done + +# ensure important stuff is enabled +for wantpkg in wireless; do + conf "/system package enable $wantpkg" +done + +# TODOs: +# setup capsman +# setup IPv6 +# setup password +# disable dhcp server + +# New script for setting up the main capsman: +# certificate generation! diff --git a/mikrotik-update.sh b/mikrotik-update.sh new file mode 100755 index 0000000..b2c0fc6 --- /dev/null +++ b/mikrotik-update.sh @@ -0,0 +1,37 @@ +#!/bin +# Nico Schottelius, 2019-12-02 +# Update mikrotik routers to the latest package + +if [ $# -lt 2 ]; then + echo "$0 router [router...]" + cat <