This commit is contained in:
斟酌 鵬兄 2016-02-21 19:57:15 +08:00
parent c2bfbfbc62
commit 1389f0027d

View File

@ -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" -e "s/_#/>/g" )
PMCC_NAME=$( echo "#_MACHINE_COLORED_NAME_#" | sed -e "s/#_/</g" -e "s/_#/>/g" )
UUID_TOK=$( echo "#_UUID_#" | sed -e "s/#_/</g" -e "s/_#/>/g" )