diff --git a/bash/bashrc/rbashrc b/bash/bashrc/rbashrc index e04ffd9..ffe0722 100644 --- a/bash/bashrc/rbashrc +++ b/bash/bashrc/rbashrc @@ -105,11 +105,25 @@ function __cacheDownload { __CFILE=$BASH_SDIR/$MLINK if [ ! -f "$__CFILE" ]; then - curl -s "$1" > "$__CFILE" + __download "$1" > "$__CFILE" __crypte "$__CFILE" fi } +function __download { + which curl 2>&1 > /dev/null + if [ $? -eq 0 ]; then + curl -s "$1" + return; + fi + + which wget 2>&1 > /dev/null + if [ $? -eq 0 ]; then + wget -qO- "$1" + return; + fi +} + function __uuid { local __out=$1 @@ -126,7 +140,7 @@ function rbash_upgrade { echo "Updating the .bashrc" __uuid TMPID TMPFILE=/tmp/$TMPID - curl -s "http://git.astropenguin.net/?p=utils.git;a=blob_plain;f=bash/bashrc/rbashrc;hb=HEAD" > $TMPFILE + __download "http://git.astropenguin.net/?p=utils.git;a=blob_plain;f=bash/bashrc/rbashrc;hb=HEAD" > $TMPFILE if [ -z "$1" ]; then MC_NAME=""