summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorP. 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)
commit5a9211e996f62750596b95a87f48bebb233cf696 (patch)
tree3ed4346b9a1c995f8aa79899f16e7249a7d5beec /src
parentd84af41141c2a578ec384f7a16169afe03bac680 (diff)
fini_vardata(): New function
Diffstat (limited to 'src')
-rw-r--r--src/vardata.sh17
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}"