From e3bb8433df3725948fc651042ed72695d0d05ab4 Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 16 Jun 2016 03:06:44 -0400 Subject: [PATCH] Fix issue 1204, rm /xcatpost folder before wget postscripts --- xCAT/postscripts/xcatdsklspost | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 28489c947..de49ba994 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -112,8 +112,12 @@ download_postscripts() retry=0 rc=1 # this is a fail return while [ 0 -eq 0 ]; do - - export LANG=C; wget -l inf -nH -N -r --waitretry=10 --random-wait -e robots=off -T 60 -nH --cut-dirs=2 --reject "index.html*" --no-parent http://$server$INSTALLDIR/postscripts/ -P /$xcatpost 2> /tmp/wget.log + + if [ -e "\/$xcatpost" ]; then + rm -rf "\/$xcatpost" + fi + + export LANG=C; wget -l inf -nH -N -r --waitretry=10 --random-wait -e robots=off -T 60 -nH --cut-dirs=2 --reject "index.html*" --no-parent http://$server$INSTALLDIR/postscripts/ -P /$xcatpost 2> /tmp/wget.log rc=$? if [ $rc -eq 0 ]; then # return from wget was 0 but some OS do not return errors, so we