#!/bin/sh

if [ -f "$1" ]; then
  libreoffice --headless --convert-to pdf "$1" && rm -rf "$1"
else
  echo "$1 is not a file." && exit 1
fi