From 5582e8c7fab8e40c4bb4e0bac17e71fe74eaab4e Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Sun, 6 Oct 2013 18:23:46 +0200 Subject: [PATCH] libreoffice-gpg: move to office-gpg, add cfg file --- libreoffice-gpg => office-gpg | 49 +++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 13 deletions(-) rename libreoffice-gpg => office-gpg (57%) diff --git a/libreoffice-gpg b/office-gpg similarity index 57% rename from libreoffice-gpg rename to office-gpg index d074cec..1e97bbc 100755 --- a/libreoffice-gpg +++ b/office-gpg @@ -1,23 +1,46 @@ #!/bin/sh -#shuber, 2008-10-18 +# Copyright (c) 2013 Stefan Huber # -# This script does a decrypt-edit-encrypt cycle with gpg and OpenOffice. -# The concrete editing program (ooffice) can be set by the variable -# $CMD. The detection if the file has been altered is done by a hash sum -# algorithm which can be set by $SUMCMD. +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without +# restriction, including without limitation the rights to use, +# copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following +# conditions: # -# Changelog: -# * 2008-10-18 Initial version -# * 2008-10-19 Introducing a CRYPTID variable -# Checking if crypted file has same checksum -# * 2010-10-23 ooffice only spawns OpenOffice and gives control back -# to shell. Hence, we have to wait for pid now. +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. + +# Author: Stefan Huber + +# +# This script does a decrypt-edit-encrypt cycle with gpg and OpenOffice resp. +# LibreOffice files. -CMD="libreoffice" SUMCMD="sha1sum" -CRYPTID="user@example.org" +CRYPTID="" +CMD="/usr/bin/libreoffice" +[ -x ${CMD} ] || CMD="/usr/bin/ooffice" + +[ -f "$HOME/.office-gpg.cfg" ] && source "$HOME/.office-gpg.cfg" + +if [ -z "$CRYPTID" ]; then + echo "No CRYPTID set in $HOME/.office-gpg.cfg" + exit 1 +fi #No valid invocation if [ $# -ne 1 ] -- 2.30.2