]> gitweb.fluxo.info Git - firma.git/commitdiff
Removed a few dependencies (bc, cat, tac).
authorluis <luis>
Wed, 31 Jan 2007 03:04:46 +0000 (03:04 +0000)
committerluis <luis>
Wed, 31 Jan 2007 03:04:46 +0000 (03:04 +0000)
GUIDELINES
firma

index fabe30738aeae3132bc5d1c8990da8521f48bda4..4c7e6f72b7594315d4690087cefdd0df11ddca66 100755 (executable)
@@ -38,22 +38,25 @@ In the future this procedure will be automatic.
    $GPG_BINARY
    $MAIL_AGENT
 
-   echo
-   cat
-   grep
-   wc
-   tr
-   seq
-   cut
-   sed
-   mkdir
-   touch
+   basename
    chmod
    chown
-   basename
+   cut
+   echo
    expect
    fold
-   uniq
-   tac
+   grep
+   head
+   logger
+   mkdir
+   mv
+   rm
+   sed
    sha1sum
+   sleep
+   sort
+   touch
+   tr
+   uniq
+   wc
 
diff --git a/firma b/firma
index 36ce02a5767d2f541a2087be9ba28698358b156f..7efa2056d76ffd40ed8def9eb2d390385c2a2b54 100755 (executable)
--- a/firma
+++ b/firma
@@ -1350,7 +1350,7 @@ EOF
   fi
 
   if [[ "$return_code" == "0" || "$?" == "0" ]]; then
-    AdminLog "use: $1 chosen for message delivery. $(echo $uid_count -1 | bc -l) UID(s) deleted from public key ${keyid:32}."
+    AdminLog "use: $1 chosen for message delivery. $(($uid_count - 1)) UID(s) deleted from public key ${keyid:32}."
   else
     return_code=1
   fi
@@ -2171,6 +2171,7 @@ function SetDeliveryRandomization {
   fi
 }
 
+
 function DeliveryRandomization {
   #-------------------------------------------------------------
   # sleep according $DELIVERY_RANDOMIZATION
@@ -2202,7 +2203,7 @@ function ReplayProtectionFlush {
   if [[ "$REPLAY_PROTECTION" == "yes" ]]; then
     if [[ -f "$REPLAY_FILE" ]]; then
       if [[ "$(wc -l $REPLAY_FILE | cut -d " " -f 1)" -gt "$REPLAY_COUNT" ]]; then
-        tac $REPLAY_FILE | head -n $REPLAY_COUNT | tac > $REPLAY_FILE
+        sed -ie '1d' $REPLAY_FILE
       fi
     else
       touch $REPLAY_FILE
@@ -2235,8 +2236,8 @@ function ReplayProtectionCheck {
       touch $REPLAY_FILE.tmp
       chown $FIRMA_USER.$FIRMA_GROUP $REPLAY_FILE.tmp
       chmod 600 $REPLAY_FILE.tmp
-      cat $REPLAY_FILE | sed -e "/^$sha1$/d" > $REPLAY_FILE.tmp
-      mv $REPLAY_FILE.tmp $REPLAY_FILE
+      sed -e "/^$sha1$/d" $REPLAY_FILE > $REPLAY_FILE.tmp
+      mv -f $REPLAY_FILE.tmp $REPLAY_FILE
       return 1
     else
       return 0