mirror of
https://github.com/elseif/MikroTikPatch
synced 2026-07-17 10:39:40 +00:00
modified: chr.sh
This commit is contained in:
parent
969c4fb369
commit
447f7990ae
3
chr.sh
3
chr.sh
@ -149,6 +149,7 @@ confirm_storge() {
|
|||||||
}
|
}
|
||||||
confirm_address() {
|
confirm_address() {
|
||||||
ETH=$(ip route show default | grep '^default' | sed -n 's/.* dev \([^\ ]*\) .*/\1/p')
|
ETH=$(ip route show default | grep '^default' | sed -n 's/.* dev \([^\ ]*\) .*/\1/p')
|
||||||
|
MAC=$(cat /sys/class/net/$ETH/address | tr 'a-z' 'A-Z')
|
||||||
ADDRESS=$(ip addr show $ETH | grep global | cut -d' ' -f 6 | head -n 1)
|
ADDRESS=$(ip addr show $ETH | grep global | cut -d' ' -f 6 | head -n 1)
|
||||||
GATEWAY=$(ip route list | grep default | cut -d' ' -f 3)
|
GATEWAY=$(ip route list | grep default | cut -d' ' -f 3)
|
||||||
if [ -f "/etc/resolv.conf" ]; then
|
if [ -f "/etc/resolv.conf" ]; then
|
||||||
@ -304,7 +305,7 @@ create_autorun() {
|
|||||||
cat <<EOF > "$MNT/rw/autorun.scr"
|
cat <<EOF > "$MNT/rw/autorun.scr"
|
||||||
/user set admin password="$RANDOM_ADMIN_PASS"
|
/user set admin password="$RANDOM_ADMIN_PASS"
|
||||||
/ip dns set servers=$DNS
|
/ip dns set servers=$DNS
|
||||||
/ip address add address=$ADDRESS interface=ether1
|
/ip address add address=$ADDRESS interface=[/interface ethernet get [find mac-address=$MAC] name]
|
||||||
/ip route add gateway=$GATEWAY
|
/ip route add gateway=$GATEWAY
|
||||||
EOF
|
EOF
|
||||||
echo "$MSG_AUTO_RUN_FILE_CREATED"
|
echo "$MSG_AUTO_RUN_FILE_CREATED"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user