diff options
author | Christos.K <freedomrfox@gmail.com> | 2017-08-29 16:48:27 +0300 |
---|---|---|
committer | Christos.K <freedomrfox@gmail.com> | 2017-08-29 16:48:27 +0300 |
commit | fe424a56838805f7a043201f6b3558a7a05c178e (patch) | |
tree | c3ee0d6029813bcd6feb0568527c5df5c2775031 | |
parent | Mount tmpfs etc (diff) | |
download | GSE-fe424a56838805f7a043201f6b3558a7a05c178e.tar.gz GSE-fe424a56838805f7a043201f6b3558a7a05c178e.tar.bz2 GSE-fe424a56838805f7a043201f6b3558a7a05c178e.zip |
Cleanup
-rwxr-xr-x | config.d/controller/modules/cinit_clean.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/config.d/controller/modules/cinit_clean.sh b/config.d/controller/modules/cinit_clean.sh index e69de29..0cdc92e 100755 --- a/config.d/controller/modules/cinit_clean.sh +++ b/config.d/controller/modules/cinit_clean.sh @@ -0,0 +1,38 @@ +# EXPORT CONTROLLER CONFDIR +CTCONFDIR=/config.d +export CTCONFDIR +# EXPORT LOCAL SCRIPTDIR +CTSCRIPTS=/usr/local/controller +export CTSCRIPTS +# UPDATE PATH +export "PATH=${PATH}:/usr/local/controller" +# CONTROLLER PRELIMINARY FUNCTIONS +source "${CTSCRIPTS}/ct_prelim.sh" +# MAKE SURE RFS BFS WORKDIR ARE NOT MOUNTED +_unmount_all_targets + +if [[ "${_ctflag_setup}" == 0 || "${_ctflag_extract}" == 0 || "${_sys_config}" == 0 ]]; then + if [[ -z "${_sys_archive}" ]]; then + if [[ -z "${_server_version}" ]]; then + _server_version="$(cat "${CTCONFDIR}/version")" + fi + + _sys_archive="stage3-amd64-${_server_version}.tar.bz2" + fi + + mount -L "SYSFS" "/mnt/workdir" + + if [[ "${_ctflag_extract}" == 0 ]]; then + rm -f "/mnt/workdir/${_sys_archive}" + rm -f "/mnt/workdir/${_sys_archive}.md5sum" + rm -f "/mnt/workdir/${_sys_archive}.sig" + fi + + if [[ "${_sys_config}" == 0 ]]; then + rm -rf "/mnt/workdir/var/tmp/ctworkdir" + fi + + umount "/mnt/workdir" +fi + + |