From f63de2667ce7e89e3136ad0bf33e3be4b146d208 Mon Sep 17 00:00:00 2001 From: Aleksandr Shamaraev <153871261+AlexanderShad@users.noreply.github.com> Date: Mon, 23 Sep 2024 13:10:16 +1100 Subject: [PATCH] new version 0.2 --- Readme.txt | 2 +- msgextract.sh | 47 ++++++++++++++++++++++++++++++++++++----------- msgextract.spec | 4 ++-- 3 files changed, 39 insertions(+), 14 deletions(-) diff --git a/Readme.txt b/Readme.txt index a9a3f06..fc803be 100644 --- a/Readme.txt +++ b/Readme.txt @@ -10,4 +10,4 @@ Spec для сборки в пакет приложен -Для установки на ALT Linux без пакета, перейдите в раздел Releases +Для установки на ALT Linux без пакета, либо с неофициального пакета, перейдите в раздел Releases diff --git a/msgextract.sh b/msgextract.sh index b3ceb2d..4863ec4 100755 --- a/msgextract.sh +++ b/msgextract.sh @@ -1,21 +1,46 @@ #!/bin/bash +# Easily extract the contents of MSG email files v.0.2 +# https://github.com/AlexanderShad/msgextract -echo -e '\033[44m --- Start extraction...--- \033[0m\n' +echo -e '\e[042;30m --- Start extraction... --- \033[0m\n' if [ -n "$1" ] ; then - cp "$(cd "$(dirname "$1")"; pwd -P)/$(basename "$1")" "$(cd "$(dirname "$1")"; pwd -P)/tfile.msg" - - msgconvert "$(cd "$(dirname "$1")"; pwd -P)/tfile.msg" - munpack "$(cd "$(dirname "$1")"; pwd -P)/tfile.eml" - - rm "$(cd "$(dirname "$1")"; pwd -P)/tfile.eml" - rm "$(cd "$(dirname "$1")"; pwd -P)/tfile.msg" + if [ -e "$(cd "$(dirname "$1")"; pwd -P)/$(basename "$1")" ] ; then + + echo '' + echo -e '\e[0;31m* creating temp file...\e[0m' + echo '' + + cp "$(cd "$(dirname "$1")"; pwd -P)/$(basename "$1")" "$(cd "$(dirname "$1")"; pwd -P)/tfile.msg" + + echo '' + echo -e '\e[0;31m* msgconverting...\e[0m' + echo '' + + msgconvert "$(cd "$(dirname "$1")"; pwd -P)/tfile.msg" + + echo '' + echo -e '\e[0;31m* munpacking...\e[0m' + echo '' + munpack "$(cd "$(dirname "$1")"; pwd -P)/tfile.eml" + + echo '' + echo -e '\e[0;31m* deleting temp files...\e[0m' + echo '' + rm "$(cd "$(dirname "$1")"; pwd -P)/tfile.eml" + rm "$(cd "$(dirname "$1")"; pwd -P)/tfile.msg" + + echo -e '\e[042;30m --- Extracted --- \033[0m\n' + + else + echo -e '\e[042;30m --- File not found. --- \033[0m\n' + fi + +else - echo -e '\033[44m --- Extracted--- \033[0m\n' + echo -e '\e[042;30m --- No parameters found. --- \033[0m\n' -else - echo -e '\033[44m --- No parameters found. --- \033[0m\n' fi diff --git a/msgextract.spec b/msgextract.spec index c2e5176..bfa2b37 100644 --- a/msgextract.spec +++ b/msgextract.spec @@ -1,5 +1,5 @@ Name: msgextract -Version: 0.1 +Version: 0.2 Release: alt1 Summary: Easily extract the contents of MSG email files @@ -28,5 +28,5 @@ install -Dm755 %_builddir/%name-%version/%name.sh %buildroot%_bindir/%name %_bindir/%name %changelog -* Sat Jul 06 2024 Aleksandr Shamaraev 0.1-alt1 +* Sun Sep 23 2024 Aleksandr Shamaraev 0.2-alt1 - first build