#!/bin/bash

cd /tmp

# make the dir /tmp/tbup

if [ -e tbup ]; then
 echo "There already is a directory /tmp/tbup !!"
 echo " This means that"
 echo "  1) another tbackup or trestore command is running, if this is the"
 echo "     case you should wait till it has terminated, or"
 echo "  2) a tbackup or trestore command terminated abnormally, in that case"
 echo "     you can answer yes to the following question."
if ! question "Delete old /tmp/tbup and continue"; then exit; fi

rm -r /tmp/tbup
fi

mkdir tbup
#prevent other users from reading named pipes etc.
chmod 700 tbup

