#!/bin/bash

# Delayed copy
# Arg 1: source
# Arg 2: destination
# Arg 3: delay in seconds
# [Arg 4]: -d   ...  delete source after copy

if [ "$1" == "" ] || [ "$2" == "" ] || [ "$3" == "" ]
then
    echo "Usage: $0 SOURCE DESTINATION DELAY[s]";
    exit 1;
fi


sleep $3

cp $1 $2

if [ "$4" == "-d" ]
then
    rm $1
fi

