Skip to content

Commit 2aaedc0

Browse files
Allow for use of cURL if there is no wget.
Added the ability to use cURL if wget is not found on the box. Saw NullArray#5 and agree that that was a poor implementation but this allows for handling of either wget or cURL. If the options for cURL aren't the ones that would give the desired output feel free to change them.
1 parent 674a585 commit 2aaedc0

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

roothelper.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,16 @@ RHelpers['rootend.zip']="https://github.com/twelvesec/rootend/archive/master.zip
4848
function rh_download(){
4949

5050
for h in "${!RHelpers[@]}"; do
51-
wget -nv -O "${rh_dest}/$h" "${RHelpers[$h]}"
51+
dest="${rh_dest}/$h"
52+
url="${RHelpers[$h]}"
53+
54+
if [ -x "$(which wget)" ] ; then
55+
wget -nv -O "$dest" "$url"
56+
elif [ -x "$(which curl)" ]; then
57+
curl -o "$dest" -sfL "$url"
58+
else
59+
echo "Could not find curl or wget."
60+
fi
5261
done
5362
}
5463

0 commit comments

Comments
 (0)