From 55626cf414f947be0ce5c8300f97f99421c2e222 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Mon, 24 Jun 2024 05:41:52 +0300 Subject: Reworked tempassin to lib/_ak_script --- lib/_ak_script | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'lib/_ak_script') diff --git a/lib/_ak_script b/lib/_ak_script index e9d7c0e..f24fbc9 100755 --- a/lib/_ak_script +++ b/lib/_ak_script @@ -67,3 +67,25 @@ _ak_not_implemented(){ #_ak_title_description _ak_log_error "Not implemented: $*" } + +_ak_make_temp_directory(){ + AK_TEMP="$(mktemp -d /tmp/aktmp-XXXXXXX)" + if [ ! -d "$AK_TEMP" ] + then + _ak_log_error "Could not make $AK_TEMP directory to work in" + exit 1 + fi + _ak_log_info "$AK_TEMP created successfully" + echo "$AK_TEMP" +} + +_ak_make_temp_file(){ + AK_TEMP="$(mktemp /tmp/aktmp-XXXXXXX)" + if [ ! -f "$AK_TEMP" ] + then + _ak_log_error "Could not make $AK_TEMP directory to work in" + exit 1 + fi + _ak_log_info "$AK_TEMP created successfully" + echo "$AK_TEMP" +} -- cgit v1.2.3