diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-01-14 21:13:28 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-01-14 21:13:28 +0100 |
commit | 11beac0694475b6c51e55d0711e9d3f26509d2b8 (patch) | |
tree | 4144237e3b7756658fe650cfc8803e5d102c3c05 /sbin/itzks-update-disklserver-squashfs-images | |
parent | 1e8c2357f0efa13865b9d25396990ac97b62904f (diff) | |
download | itzks-systems-11beac0694475b6c51e55d0711e9d3f26509d2b8.tar.gz itzks-systems-11beac0694475b6c51e55d0711e9d3f26509d2b8.tar.bz2 itzks-systems-11beac0694475b6c51e55d0711e9d3f26509d2b8.zip |
sbin/itzks-update-disklserver-squashfs-images: Make sure <chroot>/root.ssh/ folder exists before trying to copy something inside.
Diffstat (limited to 'sbin/itzks-update-disklserver-squashfs-images')
-rwxr-xr-x | sbin/itzks-update-disklserver-squashfs-images | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sbin/itzks-update-disklserver-squashfs-images b/sbin/itzks-update-disklserver-squashfs-images index ef34f37..e9906c6 100755 --- a/sbin/itzks-update-disklserver-squashfs-images +++ b/sbin/itzks-update-disklserver-squashfs-images @@ -129,8 +129,10 @@ for chroot in ${ltsp_chroots}; do for priv_key_file in id_ecdsa id_ecdsa_sk id_ed25519 id_ed25519_sk id_rsa; do if [ -e "/root/.ssh/${priv_key_file}.DLW" ] && [ ! -e "${LTSP_OPT}/${chroot}/root/.ssh/${priv_key_file}" ]; then + mkdir -p "${LTSP_OPT}/${chroot}/root/.ssh/" cp "/root/.ssh/${priv_key_file}.DLW" "${LTSP_OPT}/${chroot}/root/.ssh/${priv_key_file}" elif [ -e "/root/.ssh/${priv_key_file}" ] && [ ! -e "${LTSP_OPT}/${chroot}/root/.ssh/${priv_key_file}" ]; then + mkdir -p "${LTSP_OPT}/${chroot}/root/.ssh/" cp "/root/.ssh/${priv_key_file}" "${LTSP_OPT}/${chroot}/root/.ssh/${priv_key_file}" fi @@ -139,6 +141,7 @@ for chroot in ${ltsp_chroots}; do # Copy the SSH authorized_keys file for DLWs to ${LTSP_OPT}/${chroot}/root/.ssh/authorized_keys (e.g. disklserver:/root/.ssh/authorized_keys) # Use host's authorized_keys file for granting DLW access via SSH as root without password if [ -e "/root/.ssh/authorized_keys" ] && [ ! -e "${LTSP_OPT}/${chroot}/root/.ssh/authorized_keys" ]; then + mkdir -p "${LTSP_OPT}/${chroot}/root/.ssh/" cp "/root/.ssh/authorized_keys" "${LTSP_OPT}/${chroot}/root/.ssh/authorized_keys" fi |