Commit 5edbd34a authored by Дмитрий Сафронов's avatar Дмитрий Сафронов
Browse files

Merge branch 'key' into 'main'

key

See merge request !3
parents 28320e41 eb34385a
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -8,11 +8,11 @@ die() {
mkdir /root/openwrt

test -n "$OPENWRT_SSH_CONFIG"       && echo "$OPENWRT_SSH_CONFIG"       > /root/openwrt/config
test -n "$OPENWRT_SSH_KEY_ED25519"  && echo "$OPENWRT_SSH_KEY_ED25519"  > /root/openwrt/id_ed25519
test -n "$OPENWRT_SSH_KEY"          && echo "$OPENWRT_SSH_KEY"          > /root/openwrt/key
test -n "$OPENWRT_SSH_KNOWN_HOSTS"  && echo "$OPENWRT_SSH_KNOWN_HOSTS"  > /root/openwrt/known_hosts

rsync -a -og --chown=root:root /root/openwrt/ /root/.ssh/   || die "Couldn't rsync user ssh settings"
chown -R root:root /root/.ssh                               || die "Couldn't change ownership for user ssh settings"
chmod -R a-rwx,u+rwX /root/.ssh                             || die "Couldn't change access rights for user ssh settings"

rsync -acxv --delete-after --exclude '*-opkg' --exclude '/etc/uci-defaults/*' -e "ssh -p ${OPENWRT_SSH_PORT:-22}" "${OPENWRT_SSH_HOST:-root@192.168.1.1}:/overlay/upper/" overlay/ || die "Couldn't rsync router config"
rsync -acxv --delete-after --exclude '*-opkg' --exclude '/etc/uci-defaults/*' -e "ssh -p ${OPENWRT_SSH_PORT:-22} -i /root/.ssh/key" "${OPENWRT_SSH_HOST:-root@192.168.1.1}:/overlay/upper/" overlay/ || die "Couldn't rsync router config"