dev/provisioning/modules/puppi/files/scripts/delete.sh
author ymh <ymh.work@gmail.com>
Tue, 19 Jan 2016 19:18:34 +0100
changeset 109 d22ed5792f8e
parent 28 b0b56e0f8c7f
permissions -rwxr-xr-x
Correct transaction management. cf. bug https://openrdf.atlassian.net/browse/SES-2295 and tomcat default management of PUT request with form data (application/x-www-form-urlencoded encoded)

#!/bin/bash
# delete.sh - Made for Puppi

# Sources common header for Puppi scripts
. $(dirname $0)/header || exit 10

# Manage script variables
if [ $1 ] ; then
    tobedeleted=$1
else
    echo "You must provide a file or directory to delete!"
    exit 2 
fi

if [ "$tobedeleted" = "/" ] ; then
    echo "Be Serious!"
    exit 2
fi

# Move file
move () {
    mkdir -p $workdir/$project/deleted
    mv $tobedeleted $workdir/$project/deleted
}

move