From a3bd7ffcd9e14e2570ab54c5768f1cc2d37af5f8 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 7 Jul 2016 01:08:06 +0100 Subject: [PATCH] moved curl checking loop --- lgsm/functions/command_update_functions.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lgsm/functions/command_update_functions.sh b/lgsm/functions/command_update_functions.sh index 0e3542099..3cc9508c7 100644 --- a/lgsm/functions/command_update_functions.sh +++ b/lgsm/functions/command_update_functions.sh @@ -23,18 +23,19 @@ fi if [ -n "${functionsdir}" ]; then if [ -d "${functionsdir}" ]; then - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - curlcmd=${curlcmd} - break - fi - done cd "${functionsdir}" for functionfile in * do + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + curlcmd=${curlcmd} + break + fi + done + echo -ne " checking ${functionfile}...\c" function_file_diff=$(diff "${functionsdir}/${functionfile}" <(${curlcmd} -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}")) if [ "${function_file_diff}" != "" ]; then