From 6b4fb46bd283d26738933297902ef522493404d4 Mon Sep 17 00:00:00 2001 From: Andy Witter Date: Tue, 10 Dec 2019 11:10:26 -0500 Subject: [PATCH] update extracting of tar files to preserve symlinks --- templates/setup-head.sh | 6 +++--- templates/setup.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/setup-head.sh b/templates/setup-head.sh index 5ab6ffa..2d88e7c 100755 --- a/templates/setup-head.sh +++ b/templates/setup-head.sh @@ -41,7 +41,7 @@ then echo "The credentials file has been deleted" echo "on the previous run extracting credentials file." echo "Please wait re-extracting the credentials file" - if ! tar zxvf ../setup_head_file.tar.gz -C . setup_head_file/debconf-settings + if ! tar hxvf ../setup_head_file.tar.gz -C . setup_head_file/debconf-settings then echo echo "failed to re-extract credentials file" @@ -127,7 +127,7 @@ if [ "$OSDISTRO" == "Ubuntu" ] && [ "$OSRELEASE" == "14.04" ]; then else hostnamectl set-hostname "head_file" fi -tar zxvf head_file_etc-hosts.tar.gz -C / +tar hxvf head_file_etc-hosts.tar.gz -C / sed -i 's/^domain.*/domain CLUSTER_DOMAINNAME/g' /etc/resolv.conf sed -i 's/^search.*/search CLUSTER_DOMAINNAME/g' /etc/resolv.conf @@ -181,7 +181,7 @@ if [ -e /etc/netplan ] then rm -rf /etc/netplan fi -tar zxvf head_file.tar.gz -C / >> $INSTALL_LOG 2>&1 +tar hxvf head_file.tar.gz -C / >> $INSTALL_LOG 2>&1 ### Display extracted config files. cat $INSTALL_LOG diff --git a/templates/setup.sh b/templates/setup.sh index a2d7af6..80f8762 100755 --- a/templates/setup.sh +++ b/templates/setup.sh @@ -35,7 +35,7 @@ if [ -e $INSTALL_LOG ] echo "The credentials file has been deleted" echo "on the previous run extracting credentials file." echo "Re-extracting the credentials file" - if ! tar zxvf ../setup_tar_file.tar.gz -C . setup_tar_file/debconf-settings + if ! tar hxvf ../setup_tar_file.tar.gz -C . setup_tar_file/debconf-settings then echo echo "failed to re-extract credentials file" @@ -105,7 +105,7 @@ fi ### xtract /etc/hosts files. echo "Files Installed" -tar zxvf tar_file_etc-hosts.tar.gz -C / 2>&1 | tee -a $INSTALL_LOG +tar hxvf tar_file_etc-hosts.tar.gz -C / 2>&1 | tee -a $INSTALL_LOG ### Fixup /etc/resolv.conf sed -i 's/^domain.*/domain CLUSTER_DOMAINNAME/g' /etc/resolv.conf @@ -598,7 +598,7 @@ then rm -rf /etc/netplan fi -tar zxvf tar_file.tar.gz -C / +tar hxvf tar_file.tar.gz -C / ConfigLogging GetNics -- 2.11.0