#!/bin/sh # Copyright (c) 2008 David R. Forrest (Forrest) # # Permission to use, copy, modify, and distribute this material # for any purpose and without fee is hereby granted, provided # that the above copyright notice and this permission notice # appear in all copies, and that the name of Forrest not be # used in advertising or publicity pertaining to this # material without the specific, prior written permission # of an authorized representative of Forrest. FORREST # MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY # OF THIS MATERIAL FOR ANY PURPOSE. IT IS PROVIDED "AS IS", # WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. ( [ "$SSH_CONNECTION" ] ) && (echo "Remote display - try save"; exit 1) # Get the files into /tmp/tnef-docs # see http://sourceforge.net/project/showfiles.php?group_id=57057 mkdir -p /tmp/tnef_docs >/dev/null 2>&1 /usr/local/bin/tnef --body-pref=all --number-backups --directory=/tmp/tnef_docs $1 # # Display and delete files found by tnef using our octet-stream program DIRSIZE=`ls -l /tmp/tnef_docs/|grep total|cut -b7-` test $DIRSIZE = 0 && exit 1 # bail if empty for i in /tmp/tnef_docs/*; do /usr/local/bin/octet-stream "$i" && rm "$i" ; done