From daea3fdc0da6fd3b3ec94933043a23bbcc9c7d39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Tue, 10 Mar 2015 12:50:25 +0800 Subject: [PATCH] cache __ns --- bash/bashrc/rbashrc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bash/bashrc/rbashrc b/bash/bashrc/rbashrc index a685431..43ae775 100644 --- a/bash/bashrc/rbashrc +++ b/bash/bashrc/rbashrc @@ -67,11 +67,11 @@ export BASH_SDIR=/tmp/$BASHL_UUID function __cryptd { - echo "" | gpg --passphrase-fd 0 -o "$2" -d "$1" + echo "" | gpg -q --passphrase-fd 0 -o "$2" -d "$1" } function __crypte { - echo "" | gpg --passphrase-fd 0 -o "$1.enc" -c "$1" + echo "" | gpg -q --passphrase-fd 0 -o "$1.enc" -c "$1" mv "$1.enc" "$1" } __CFILE="" @@ -134,8 +134,10 @@ export EDITOR=vim echo "Source:" function __ns { echo " $1" + __cacheDownload "http://git.astropenguin.net/?p=utils.git;a=blob_plain;f=bash/bashrc/sources/$1;hb=HEAD" + shift TMPFILE=/tmp/$( cat /proc/sys/kernel/random/uuid ) - curl -s "http://git.astropenguin.net/?p=utils.git;a=blob_plain;f=bash/bashrc/sources/$1;hb=HEAD" > $TMPFILE + __cryptd "$__CFILE" "$TMPFILE" . $TMPFILE rm $TMPFILE }