From b47ac2bd6a2b0cec984f6a7b56f822a1c2764ee5 Mon Sep 17 00:00:00 2001 From: James Swineson Date: Tue, 9 Apr 2019 15:59:03 +0800 Subject: [PATCH] do not fail if cannot find config --- menhera.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/menhera.sh b/menhera.sh index 5c24315..fca7779 100755 --- a/menhera.sh +++ b/menhera.sh @@ -68,10 +68,10 @@ install_software() { copy_config() { echo "Copying important config into new rootfs..." - cp -ax "${OLDROOT}/etc/resolv.conf" "${NEWROOT}/etc" - cp -axr "${OLDROOT}/etc/ssh" "${NEWROOT}/etc" - cp -ax "${OLDROOT}/etc/"{passwd,shadow} "${NEWROOT}/etc" - cp -axr "${OLDROOT}/root/.ssh" "${NEWROOT}/root" + ! cp -ax "${OLDROOT}/etc/resolv.conf" "${NEWROOT}/etc" + ! cp -axr "${OLDROOT}/etc/ssh" "${NEWROOT}/etc" + ! cp -ax "${OLDROOT}/etc/"{passwd,shadow} "${NEWROOT}/etc" + ! cp -axr "${OLDROOT}/root/.ssh" "${NEWROOT}/root" chroot "${NEWROOT}" chsh -s /bin/bash root }