diff --git a/extras/golang.install b/extras/golang.install index 24775da..f243eec 100644 --- a/extras/golang.install +++ b/extras/golang.install @@ -15,7 +15,21 @@ export PATH=\$PATH:/usr/local/go/bin if [ ! -z $prbl_functions ] ; then source $prbl_functions else - source <(curl -ks 'https://raw.githubusercontent.com/pyr0ball/PRbL/master/functions') + if [ -f ${rundir}/functions ] ; then + source ${rundir}/functions + else + # Iterate through get commands and fall back on next if unavailable + if command -v curl >/dev/null 2>&1; then + source <(curl -ks 'https://raw.githubusercontent.com/pyr0ball/PRbL/main/functions') + elif command -v wget >/dev/null 2>&1; then + source <(wget -qO- 'https://raw.githubusercontent.com/pyr0ball/PRbL/main/functions') + elif command -v fetch >/dev/null 2>&1; then + source <(fetch -qo- 'https://raw.githubusercontent.com/pyr0ball/PRbL/main/functions') + else + echo "Error: curl, wget, and fetch commands are not available. Please install one to retrieve PRbL functions." + exit 1 + fi + fi fi logfile="${rundir}/${pretty_date}_${scriptname}.log"