-#!/bin/bash
+#!/usr/bin/env bash
# monkeysphere: MonkeySphere client tool
#
keyExpire=
# get options
- TEMP=$(getopt -o l:e: -l length:,expire: -n "$PGRM" -- "$@")
+ TEMP=$(PATH="/usr/local/bin:$PATH" getopt -o l:e: -l length:,expire: -n "$PGRM" -- "$@") || failure "getopt failed! Does your getopt support GNU-style long options?"
if [ $? != 0 ] ; then
exit 1
)
log verbose "generating subkey..."
- fifoDir=$(mktemp -d)
+ fifoDir=$(mktemp -d ${TMPDIR:-/tmp}/tmp.XXXXXXXXXX)
(umask 077 && mkfifo "$fifoDir/pass")
echo "$editCommands" | gpg --passphrase-fd 3 3< "$fifoDir/pass" --expert --command-fd 0 --edit-key "$keyID" &
You might want to 'monkeysphere gen-subkey'"
fi
- workingdir=$(mktemp -d)
+ workingdir=$(mktemp -d ${TMPDIR:-/tmp}/tmp.XXXXXXXXXX)
umask 077
mkfifo "$workingdir/passphrase"
keysuccess=1