diary-new (352B)
1 #!/bin/bash 2 GPG_KEYID=${DIARY_KEYID:-"83BB96DF"} 3 ENTRIES_DIR=${DIARY_DIRECTORY:-"/Users/synox/diary"} 4 EDITOR=${DIARY_EDITOR:-"vi"} 5 6 tmp=$(mktemp /dev/shm/diary.XXXXXXXXXX) 7 $EDITOR "$tmp" 8 9 dest="$ENTRIES_DIR/$(date +%Y-%m-%d-%H%M%S).txt.gpg" 10 gpg --output "$dest" --encrypt --armor --recipient "$GPG_KEYID" --yes --quiet "$tmp" 11 ls -la "$dest" 12 13 rm "$tmp"