diff options
Diffstat (limited to 'remote')
| -rw-r--r-- | remote/includes/cleanup.inc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/remote/includes/cleanup.inc b/remote/includes/cleanup.inc new file mode 100644 index 00000000..144d7fd9 --- /dev/null +++ b/remote/includes/cleanup.inc @@ -0,0 +1,29 @@ +# ----------------------------------------------------------------------------- +# +# Copyright (c) 2014 - OpenSLX GmbH +# +# This program is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your suggestions, praise, or complaints to feedback@openslx.org +# +# General information about OpenSLX can be found at http://openslx.org/ +# ----------------------------------------------------------------------------- +# +# Trapped cleanup functions +# +# ----------------------------------------------------------------------------- + +# run 'cleanexit' when CTRL-c is pressed, an abrupt program termination or exit happens +trap cleanexit SIGINT SIGTERM + +# main cleaner function +cleanexit() { + pinfo "SIGINT/SIGTERM triggered - cleaning up ..." + # unmount and remove the temporary chroot stuff + chroot_cleanup_mounts + + # TODO vmware etc/vmware/config stuff here, if it is still needed + +} |
