uccpass: don't assume $USER is set from the shell
[zanchey/uccpass.git] / uccpass
diff --git a/uccpass b/uccpass
index 7f7bb9d..f399803 100755 (executable)
--- a/uccpass
+++ b/uccpass
@@ -37,6 +37,7 @@ init () {
     export PASSWORD_STORE_DIR="$UCCPASS_ROOT/store"
     export PASSWORD_STORE_UMASK=007
 
+    USER=`whoami`
     export GIT_AUTHOR_EMAIL="[email protected]"
     export GIT_AUTHOR_NAME="`getent passwd $USER | cut -d: -f5`"
 
@@ -127,10 +128,10 @@ new_user_setup () {
 
     # Add to .gpg-id
     echo -n " >> Adding your key to the access list... "
-    if grep -qF "$KEY_FINGERPRINT" $PASSWORD_STORE_DIR/.gpg-id; then
+    if grep -qF "<$GIT_AUTHOR_EMAIL>" $PASSWORD_STORE_DIR/.gpg-id; then
         echo "already present!"
     else
-        echo "$KEY_FINGERPRINT" >> $PASSWORD_STORE_DIR/.gpg-id
+        echo "<$GIT_AUTHOR_EMAIL>" >> $PASSWORD_STORE_DIR/.gpg-id
         echo "ok."
     fi
 

UCC git Repository :: git.ucc.asn.au