update extracting of tar files to preserve symlinks
authorAndy Witter <awitter@georgialibraries.org>
Tue, 10 Dec 2019 16:10:26 +0000 (11:10 -0500)
committerAndy Witter <awitter@georgialibraries.org>
Tue, 10 Dec 2019 16:10:26 +0000 (11:10 -0500)
templates/setup-head.sh
templates/setup.sh

index 5ab6ffa..2d88e7c 100755 (executable)
@@ -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
index a2d7af6..80f8762 100755 (executable)
@@ -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