Compare commits
2 commits
570fa60df3
...
b36658a0ee
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b36658a0ee | ||
![]() |
21b64f79da |
1 changed files with 18 additions and 2 deletions
|
@ -82,11 +82,27 @@ interrupt_handler() {
|
||||||
exit 130
|
exit 130
|
||||||
}
|
}
|
||||||
|
|
||||||
# Cleanup function
|
# Function to clean up temporary files
|
||||||
cleanup() {
|
cleanup_files() {
|
||||||
# Remove temporary files if they exist
|
# Remove temporary files if they exist
|
||||||
[ -f "/tmp/crowdsec_services.tmp" ] && rm -f "/tmp/crowdsec_services.tmp"
|
[ -f "/tmp/crowdsec_services.tmp" ] && rm -f "/tmp/crowdsec_services.tmp"
|
||||||
[ -f "/tmp/crowdsec_packages.tmp" ] && rm -f "/tmp/crowdsec_packages.tmp"
|
[ -f "/tmp/crowdsec_packages.tmp" ] && rm -f "/tmp/crowdsec_packages.tmp"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to remove the script
|
||||||
|
remove_script() {
|
||||||
|
if [ -f "$0" ]; then
|
||||||
|
rm -f -- "$0"
|
||||||
|
fi
|
||||||
|
if [ -f "task_formatter.sh" ]; then
|
||||||
|
rm -f task_formatter.sh
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# Main cleanup function
|
||||||
|
cleanup() {
|
||||||
format_output cleanup_files "Cleaning up temporary files"
|
format_output cleanup_files "Cleaning up temporary files"
|
||||||
format_output remove_script "Removing script"
|
format_output remove_script "Removing script"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue