Browse Source

scriptlog will no longer be used if not installed

pull/743/head
Daniel Gibbs 9 years ago
parent
commit
2d31f4795c
  1. 17
      functions/core_dl.sh

17
functions/core_dl.sh

@ -111,32 +111,39 @@ if [ ! -f "${filedir}/${filename}" ]; then
# if larger file shows progress bar # if larger file shows progress bar
if [ ${filename##*.} == "bz2" ]; then if [ ${filename##*.} == "bz2" ]; then
echo -ne "downloading ${filename}..." echo -ne "downloading ${filename}..."
fn_scriptlog "downloading ${filename}" if [ -z "${scriptlog}" ]; then
fn_scriptlog "downloading ${filename}"
fi
sleep 1 sleep 1
curlcmd=$(${curlcmd} --progress-bar --fail -o "${filedir}/${filename}" "${fileurl}") curlcmd=$(${curlcmd} --progress-bar --fail -o "${filedir}/${filename}" "${fileurl}")
echo -ne "downloading ${filename}..." echo -ne "downloading ${filename}..."
else else
echo -ne " fetching ${filename}...\c" echo -ne " fetching ${filename}...\c"
fn_scriptlog "fetching ${filename}" if [ -z "${scriptlog}" ]; then
fn_scriptlog "fetching ${filename}"
fi
curlcmd=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${fileurl}" 2>&1) curlcmd=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${fileurl}" 2>&1)
fi fi
local exitcode=$? local exitcode=$?
if [ ${exitcode} -ne 0 ]; then if [ ${exitcode} -ne 0 ]; then
fn_printfaileolnl fn_printfaileolnl
fn_scriptlog "downloading ${filename}: FAIL" if [ -z "${scriptlog}" ]; then
fn_scriptlog "downloading ${filename}: FAIL"
fi
echo "${curlcmd}" | tee -a "${scriptlog}" echo "${curlcmd}" | tee -a "${scriptlog}"
echo -e "${fileurl}\n" | tee -a "${scriptlog}" echo -e "${fileurl}\n" | tee -a "${scriptlog}"
exit ${exitcode} exit ${exitcode}
else else
fn_printokeolnl fn_printokeolnl
fn_scriptlog "downloading ${filename}: OK" if [ -z "${scriptlog}" ]; then
fn_scriptlog "downloading ${filename}: OK"
fi
fi fi
# remove trap # remove trap
trap - INT trap - INT
else else
fn_printfaileolnl fn_printfaileolnl
echo "Curl is not installed!" echo "Curl is not installed!"
fn_scriptlog "Curl is not installed!"
echo -e "" echo -e ""
exit 1 exit 1
fi fi

Loading…
Cancel
Save