From 8bf6b7ed94bf694dadfc81741affa62797969a79 Mon Sep 17 00:00:00 2001 From: Xavier Petit <32063953+xpetit@users.noreply.github.com> Date: Wed, 11 Sep 2019 19:59:12 +0100 Subject: [PATCH] Add overwrite capability --- scripts/install_client.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/install_client.sh b/scripts/install_client.sh index 0b47907a..32727d84 100755 --- a/scripts/install_client.sh +++ b/scripts/install_client.sh @@ -62,6 +62,25 @@ rm /usr/share/initramfs-tools/hooks/fsck cp -r system /tmp cd /tmp/system + +# Overwrite with custom files from Git repository +if test -v OVERWRITE; then + IFS=, + for item in $OVERWRITE; do + folder=$(echo "$item" | cut -d';' -f1) + url=$(echo "$item" | cut -d';' -f2) + if git ls-remote -q "$url" &>/dev/null; then + tmp=$(mktemp -d) + git clone --depth 1 "$url" "$tmp" + rm -rf "$tmp"/.git + cp -aT "$tmp" "$folder" + rm -rf "$tmp" + fi + done + IFS=' +' +fi + sed -i -e "s|::DISK::|$DISK|g" etc/udev/rules.d/10-local.rules apt-get -y install overlayroot