【linux】buildroot编译后同步脚本(开启自动联网、开启SSH免密登录)

#!/bin/bash
proc() {
    local command=("$@")
    if "${command[@]}"; then
        echo -e "\033[42;32m SUCCEED-> \033[0m ${command[@]}" >&2
    else
        echo -e "\033[41;32m FAILED-> \033[0m ${command[@]}" >&2
        exit 1
    fi
}

proc cp ../buildroot/buildroot-2017.08.1/output/images/rootfs.tar .
proc tar -xvf rootfs.tar -C ./fs2

autoeth=./fs2/etc/network/interfaces
proc echo 'auto eth0'>>${autoeth}
proc echo 'iface eth0 inet dhcp'>>${autoeth}

autossh=./fs2/etc/ssh/sshd_config
proc echo 'PasswordAuthentication yes'>>${autossh}
proc echo 'PermitEmptyPasswords yes'>>${autossh}
proc echo 'PermitRootLogin yes'>>${autossh}

你可能感兴趣的:(linux,ssh,运维)