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