From 4870aca1fdab73bd7915bf370f1037523ea518b2 Mon Sep 17 00:00:00 2001 From: Gandalf Date: Sun, 14 Mar 2021 13:56:28 +0100 Subject: [PATCH] Include possibility to use Letterheads address sysem --- README.md | 3 ++- fax.sh | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e6eeec0..f0147f2 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Spaces in filename seem to make trouble at the moment - avoid them. `balance.sh` just gives your account balance. -`faxreport.sh [options] [id]` loads the report of a given fax id (as shown by status.sh). If no `id` ist given, it takes the last sent fax from this machine. +`faxreport.sh [options] [id]` loads the report of a given fax id (as shown by status.sh). If no `id` ist given, it takes the last fax sent from this machine. Options: * `-p` to only print and not save the report @@ -28,6 +28,7 @@ Put alias fax="/your/path/to/this/project/fax.sh" alias faxstatus="/your/path/to/this/project/status.sh" alias faxbalance="/your/path/to/this/project/balance.sh" +fax-from-handle () { fax $1 "$(/your/path/to/this/project/Letterhead/Adressen/address.sh -f $2)"; } ``` into your `.bashrc` or `.bash_aliases` diff --git a/fax.sh b/fax.sh index 44455a9..672410e 100755 --- a/fax.sh +++ b/fax.sh @@ -1,7 +1,7 @@ #! /bin/bash #Check if I have enough parameters: -if [ -z $2 ] +if [ -z "$2" ] then echo "Usage: $ ./fax.sh @@ -13,7 +13,7 @@ BASEPATH=$(dirname $(realpath $0)) #Prepare fax credentials: FILE=$1 echo -n "Sending file ${FILE} " -REC=$(echo $2 | sed -e 's:[^+0-9]::g' -e 's:^0\([1-9]\):+49\1:') +REC=$(echo "$2" | sed -e 's:[^+0-9]::g' -e 's:^0\([1-9]\):+49\1:') echo "to $REC" #Needs to be base64 encoded: CONTENT=$(base64 $FILE -w 0)