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