[mikrotik] add scripts to setup/configure basic mikrotik stuff
This commit is contained in:
parent
704f2dab7c
commit
678d1bec02
2 changed files with 82 additions and 0 deletions
45
mikrotik-setup.sh
Normal file
45
mikrotik-setup.sh
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#!/bin/sh
|
||||
# Nico Schottelius, 2019-12-02
|
||||
# Setup standard mikrotik settings
|
||||
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "$0 <target> [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!
|
||||
Loading…
Add table
Add a link
Reference in a new issue