diff --git a/bash/bashrc/rbashrc b/bash/bashrc/rbashrc index 4341391..118b092 100644 --- a/bash/bashrc/rbashrc +++ b/bash/bashrc/rbashrc @@ -111,17 +111,21 @@ function __cacheDownload { } function __uuid { - which -s uuidgen + local __out=$1 + + which uuidgen 2&>1 > /dev/null if [ $? -eq 0 ]; then - uuidgen + local uuid=$( uuidgen ) else - cat /proc/sys/kernel/random/uuid + local uuid=$( cat /proc/sys/kernel/random/uuid ) fi + eval $__out="'$uuid'" } function rbash_upgrade { echo "Updating the .bashrc" - TMPFILE=/tmp/$( __uuid ) + __uuid TEMP_UUID + TMPFILE=/tmp/$TEMP_UUID curl -s "http://git.astropenguin.net/?p=utils.git;a=blob_plain;f=bash/bashrc/rbashrc;hb=HEAD" > $TMPFILE if [ -z "$1" ]; then @@ -132,8 +136,8 @@ function rbash_upgrade { MCC_NAME=$2 fi - UUID=$( __uuid ) - PASS=$( __uuid ) + __uuid UUID + __uuid PASS PMC_NAME=$( echo "#_MACHINE_NAME_#" | sed -e "s/#_//g" ) PMCC_NAME=$( echo "#_MACHINE_COLORED_NAME_#" | sed -e "s/#_//g" ) UUID_TOK=$( echo "#_UUID_#" | sed -e "s/#_//g" )