#!/bin/bash
#
# recordum_rm
#
# v0.1 2013-03-28 RE
#
# deletes a file

MYSELF=$( basename $0 )

script_help() {
    cat <<EOF
${MYSELF} help:

This script deletes a file. It needs root privileges!

Usage: ${MYSELF} <TARGET>

where:
    TARGET ... absolut path / target file

EOF
}

if [[ $# -lt 1 ]] || [[ $# -gt 1 ]]
then
    echo "incorrect number of commandline parameters!"
    script_help
    exit 1
fi

if [[ $UID -gt 0 ]]
then
    echo "$MYSELF needs to be run as superuser. You are $USER."
    exit 2
fi

TARGET=$1

# clean out older tmp files
/bin/rm -f ${TARGET} || exit 3

exit 0
