aboutsummaryrefslogtreecommitdiff
path: root/lib/_ak_fs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/_ak_fs')
-rwxr-xr-xlib/_ak_fs13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/_ak_fs b/lib/_ak_fs
index 9bf7022..07929b6 100755
--- a/lib/_ak_fs
+++ b/lib/_ak_fs
@@ -18,8 +18,9 @@
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_log
-source $AK_LIBDIR/_ak_hash_exchange
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
+_ak_lib_load _ak_hash_exchange
function _ak_fs_dir_init_setup(){
_ak_check_and_create_dir $AK_MAPSDIR
@@ -111,6 +112,14 @@ function _ak_fs_import(){
#
_ak_log_info "Storing original hash of $1 along with its name"
sha512sum "$1" > $TEMPDIR/3rd_gen_map
+ hashgrep="$(grep -rn $(cat $TEMPDIR/3rd_gen_map | cut -d ' ' -f 1) $AK_MAPSDIR)"
+ if [ $? -eq 0 ]
+ then
+ map="$(basename $( echo $hashgrep | cut -d ':' -f 1 ))"
+ _ak_log_error "File $1 found @ $map"
+ echo $map
+ exit 0
+ fi
_ak_log_info "Encoding to base64"
base64 $1 > file
FILE="file"