diff options
author | P. J. McDermott <pj@pehjota.net> | 2015-12-07 12:46:19 (EST) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2015-12-07 12:46:19 (EST) |
commit | 5a9211e996f62750596b95a87f48bebb233cf696 (patch) | |
tree | 3ed4346b9a1c995f8aa79899f16e7249a7d5beec | |
parent | d84af41141c2a578ec384f7a16169afe03bac680 (diff) |
fini_vardata(): New function
-rw-r--r-- | src/vardata.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/vardata.sh b/src/vardata.sh index 768cdf7..05c9cff 100644 --- a/src/vardata.sh +++ b/src/vardata.sh @@ -48,6 +48,23 @@ init_vardata() return 0 } +fini_vardata() +{ + local dir='' + + for dir in ${VARDATA_DIRS}; do + if ! rmdir "${vardatadir}/${dir}"; then + error 2 "$(get_msg 'temp_rmdir_fail')" \ + "${vardatadir}/${dir}" + fi + done + if ! rmdir "${vardatadir}"; then + error 2 "$(get_msg 'temp_rmdir_fail')" "${vardatadir}" + fi + + return 0 +} + get_vardata_dir() { local dir="${1}" |