add cleanup
This commit is contained in:
parent
e3b2807b6a
commit
0b2c7e3ed8
38
inst-raps.sh
38
inst-raps.sh
@ -65,6 +65,31 @@ function printSubInfo() {
|
|||||||
echo -e " - $1"
|
echo -e " - $1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function delete_folder() {
|
||||||
|
local folder_path=$1
|
||||||
|
if [ -z "$folder_path" ]; then
|
||||||
|
printError "Error: Folder path not provided."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d "$folder_path" ]; then
|
||||||
|
rm -rf "$folder_path"
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
printSuccess "Folder '$folder_path' deleted successfully."
|
||||||
|
else
|
||||||
|
printError "Error: Failed to delete folder '$folder_path'."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Clean upset timezone
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
printInfo "CleanUp"
|
||||||
|
delete_folder "/tmp/yumupd"
|
||||||
|
delete_folder "/tmp/hostsupd"
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# install rootfs-expand
|
# install rootfs-expand
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
@ -96,6 +121,10 @@ else
|
|||||||
# printSuccess "Root partition extended"
|
# printSuccess "Root partition extended"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# cleanup /tmp/file
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# install package python
|
# install package python
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
@ -183,13 +212,8 @@ printSuccess "Role updated successfully"
|
|||||||
# Clean upset timezone
|
# Clean upset timezone
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
printInfo "CleanUp"
|
printInfo "CleanUp"
|
||||||
rm -rf /tmp/yumupd
|
delete_folder "/tmp/yumupd"
|
||||||
rerror1=$?
|
delete_folder "/tmp/hostsupd"
|
||||||
rm -rf /tmp/hostsupd
|
|
||||||
$rerror2=$?
|
|
||||||
sum=$(( $rerror1 + $rerror2 ))
|
|
||||||
if [ $sum -ne 0 ]; then printError "Problem to cleanUP";exit; fi
|
|
||||||
printSuccess "CleanUp successfully"
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# set timezone
|
# set timezone
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user