]> gitweb.fluxo.info Git - firma.git/commitdiff
NewList update
authorrhatto <rhatto>
Mon, 9 Oct 2006 21:13:46 +0000 (21:13 +0000)
committerrhatto <rhatto>
Mon, 9 Oct 2006 21:13:46 +0000 (21:13 +0000)
firma

diff --git a/firma b/firma
index ffeec5647eb6b96f205a27b79f0cd3b35fc09119..aa295db49e5fa2a86b988a9099a67c11322782f6 100755 (executable)
--- a/firma
+++ b/firma
@@ -870,6 +870,7 @@ function NewList {
   #-------------------------------------------------------------
 
   local -i return_code=0
+  local answer
 
   if [ ! -d "$LIST_PATH" ]; then
 
@@ -877,6 +878,7 @@ function NewList {
     if mkdir "$LIST_PATH"; then # || (echo "$(basename $0): error creating $LIST_PATH: installation aborted"; exit 1)
       echo "Creating list config file and will ask some questions."
 
+    # TODO: try to create $LIST_HOMEDIR
     read -rep "  List keyring location: ("$LIST_PATH") " LIST_HOMEDIR
     LIST_HOMEDIR=${LIST_HOMEDIR:-"$LIST_PATH"}
 
@@ -886,7 +888,10 @@ function NewList {
     read -rep "  List description (optional): " DESCRIPTION
     read -resp "  Passphrase to protect the list's secret key: " PASSPHRASE
 
-    # TODO: key specs (size, expiry date...)
+    # TODO: automatically create a passphrase
+    # TODO: key specs: size, expiry date...
+    # TODO: CheckValidEmail $LIST_ADDRESS...
+    # TODO: for admin in $LIST_ADMIN; do CheckValidEmail $admin...
 
     echo "Creating your config..."
     touch $LIST_CONFIG_FILE
@@ -914,7 +919,20 @@ function NewList {
 
 EOF
 
-      # TODO: import admin pubkey and send list pubkey to admin
+      while true; do
+        read -rep "  Send list public key to list admins? (Y/n) " answer
+        answer="`echo $answer | tr '[:lower:]' '[:upper:]'`"
+        if [ "$answer" == "Y" ] || [ "$answer" == "YES" ]; then
+          SendListPubkey $LIST_ADMIN
+          break
+        elif [ "$answer" == "N" ] || [ "$answer" == "NO" ]; then
+          echo "  Not sending public key from list to admins. Do it manually."
+          break
+        else
+          echo "  Please answer either yes or no."
+        fi
+      done
+
       chown -R $FIRMA_USER.$FIRMA_GROUP $LIST_HOMEDIR
 
     else