Skip to content

Commit

Permalink
bdinfo / fix issues on getting bdinfo summary
Browse files Browse the repository at this point in the history
  • Loading branch information
Aniverse committed May 1, 2018
1 parent 77c56ce commit 1bc5d96
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions app/bdinfo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# https://github.com/Aniverse/iFeral
# Author: Aniverse
# 2018.04.14
# 2018.05.01

black=$(tput setaf 0); red=$(tput setaf 1); green=$(tput setaf 2); yellow=$(tput setaf 3); blue=$(tput setaf 4)
magenta=$(tput setaf 5); cyan=$(tput setaf 6); white=$(tput setaf 7); bold=$(tput bold); normal=$(tput sgr0) ; jiacu=${normal}${bold}
Expand Down Expand Up @@ -40,22 +40,22 @@ mono $bdinfocli_path "$bdmvpath" $outputpath

[[ ! $? -eq 0 ]] && echo "${bold}运行 BDinfo 出错,退出脚本 ...${normal}" && exit 1

sed -n '/QUICK SUMMARY/,//p' "${outputpath}/BDINFO.${file_title_clean}.txt" > temptext
sed -n '/QUICK SUMMARY/,//p' "${outputpath}/BDINFO.${file_title}.txt" > temptext
count=`wc -l temptext | awk '{print $1-1}' `
head -n $count temptext > "${outputpath}/${file_title_clean}.bdinfo.quick.summary.txt"
rm temptext

sed -n '/DISC INFO/,/FILES/p' "${outputpath}/BDINFO.${file_title_clean}.txt" > temptext
sed -n '/DISC INFO/,/FILES/p' "${outputpath}/BDINFO.${file_title}.txt" > temptext
count=`wc -l temptext | awk '{print $1-2}' `
head -n $count temptext > "${outputpath}/${file_title_clean}.bdinfo.main.summary.txt"
rm temptext

mv "${outputpath}/BDINFO.${file_title_clean}.txt" "${outputpath}/${file_title_clean}.bdinfo.txt"
mv "${outputpath}/BDINFO.${file_title}.txt" "${outputpath}/${file_title_clean}.bdinfo.txt"

clear
echo -e "${bold}扫描完成。生成的 BDinfo 报告存放在 ${blue}\"${outputpath}\"${normal}"

echo -e "\n${bold}${blue}---------------------------------------- BDinfo Main Summary ----------------------------------------${normal}\n"
if [[ ! `command -v lolcat` ]]; then cat "${outputpath}/${file_title_clean}.bdinfo.main.summary.txt"
else cat "${outputpath}/${file_title_clean}.bdinfo.main.summary.txt" | lolcat ; fi
echo -e "\n${bold}${blue}---------------------------------------- BDinfo Quick Summary ----------------------------------------${normal}\n"
if [[ ! `command -v lolcat` ]]; then cat "${outputpath}/${file_title_clean}.bdinfo.quick.summary.txt"
else cat "${outputpath}/${file_title_clean}.bdinfo.quick.summary.txt" | lolcat ; fi
echo -e "\n${bold}${blue}------------------------------- Just copy them, no need to download it -------------------------------${normal}\n"

0 comments on commit 1bc5d96

Please sign in to comment.