diff --git a/entrypoint.sh b/entrypoint.sh index ae99cf2ac9b58b870f145a64e6ae7535cbead8cc..f53bb2942e2aa53636743e5fbcda21514e24d49f 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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"