Blame Scripts/Functions/cli_terminateScriptExecution.sh
|
|
9b5ad9 |
#!/bin/bash
|
|
|
9b5ad9 |
#
|
|
|
9b5ad9 |
# cli_terminateScriptExecution.sh -- This function standardizes the
|
|
|
9b5ad9 |
|
|
|
9b5ad9 |
# execution (e.g., cleaning temporal files). This function is the one
|
|
|
9b5ad9 |
|
|
|
9b5ad9 |
|
|
|
9b5ad9 |
#
|
|
|
9b5ad9 |
# Copyright (C) 2009, 2010, 2011 The CentOS Project
|
|
|
9b5ad9 |
#
|
|
|
9b5ad9 |
# This program is free software; you can redistribute it and/or modify
|
|
|
9b5ad9 |
|
|
|
9b5ad9 |
|
|
|
9b5ad9 |
|
|
|
9b5ad9 |
#
|
|
|
9b5ad9 |
|
|
|
9b5ad9 |
|
|
|
9b5ad9 |
|
|
|
9b5ad9 |
# General Public License for more details.
|
|
|
9b5ad9 |
#
|
|
|
9b5ad9 |
|
|
|
9b5ad9 |
# along with this program; if not, write to the Free Software
|
|
|
9b5ad9 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
9b5ad9 |
#
|
|
|
9b5ad9 |
# ----------------------------------------------------------------------
|
|
|
9b5ad9 |
# $Id$
|
|
|
9b5ad9 |
# ----------------------------------------------------------------------
|
|
|
9b5ad9 |
|
|
|
9b5ad9 |
function cli_terminateScriptExecution {
|
|
|
9b5ad9 |
|
|
|
9b5ad9 |
# Build list of temporal files related to this script execution.
|
|
|
9b5ad9 |
|
|
|
9b5ad9 |
|
|
|
9b5ad9 |
|
|
|
9b5ad9 |
|
|
|
9b5ad9 |
|
|
|
9b5ad9 |
local FILES=$(cli_getFilesList ${CLI_TEMPDIR} \
|
|
|
9b5ad9 |
--pattern="${CLI_PROGRAM}-${CLI_PROGRAM_ID}-.+" \
|
|
|
9b5ad9 |
--maxdepth="1" --uid="$(id -u)")
|
|
|
9b5ad9 |
|
|
|
9b5ad9 |
# Remove list of temporal files related to this script execution,
|
|
|
9b5ad9 |
|
|
|
9b5ad9 |
|
|
|
9b5ad9 |
if [[ $FILES != '' ]];then
|
|
|
f9f63c |
rm -rf $FILES
|
|
|
9b5ad9 |
fi
|
|
|
9b5ad9 |
|
|
|
f9f63c |
|
|
|
f9f63c |
exit 0
|
|
|
f9f63c |
|
|
|
9b5ad9 |
}
|