Last active
July 29, 2021 04:54
-
-
Save HexagonWin/204f68ec2acb161473062e7237d4cbdd to your computer and use it in GitHub Desktop.
Backup the Pantech BINX & Kernel Source files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## THIS SOFTWARE IS FREE SOFTWARE LICENSED UNDER THE GNU GPL V3 | |
export IPH_SITE=pantech.iyagi.net | |
export IPH_SITE_PROT=http://$IPH_SITE | |
export IPH_PRGROOT=$(pwd) | |
export IPH_INITIME=$(date) | |
export IPH_WAITTIME=2 | |
# ^Seconds | |
RED='\033[0;31m' | |
NC='\033[0m' | |
LG='\033[0;37m' | |
PA='\033[0;36m' | |
YEL='\033[1;33m' | |
GRE='\033[1;32m' | |
PUR='\033[1;35m' | |
echo "You ran iPanhect Downloader Version 1.1 : Executable name $0" | |
echo "Target server - $IPH_SITE_PROT" | |
case "$0" in | |
*\ * ) | |
echo -e "${RED}✗ ERROR: File name contains spaces. Rename and try again.${NC}" | |
exit | |
;; | |
*) | |
echo -e "${GRE}✓ OK: Problem detection mechanism passed!" | |
;; | |
esac | |
echo -e "${RED}__________________________________________________________________________ " | |
echo -e "${RED}|${LG} . . . . . . . . . . . . . . . . . ${RED}|" | |
echo -e "${RED}|${LG} ${PA}..S888@S8${LG}. . . . . . . . . . ${RED}|" | |
echo -e "${RED}|${LG} . ${PA}XS.S%@8@ ;S:${LG} ..:. . .... .:...:.:.:....:.:.:. . :t;.. .:. .... ${RED}|" | |
echo -e "${RED}|${LG} ${PA}St;8: .; %888: tX%SX. St8X. St8%@8S8S8XtS%XX8S88t8X8X8XSt8t8 8t@${LG}. ${RED}|" | |
echo -e "${RED}|${LG} .${PA}8.@%${LG}.. . .${PA}8;t; 8.X@:8 St;:8 S;S; %tt :%t%${LG} . ${PA}8;%X SX.888 8.8: ${RED}|" | |
echo -e "${RED}|${LG} ${PA}S88%${LG} . .${PA}X.@t@.@%8.tX;S:;@:8X:; @88% .%;.888X 88X.. .:8;X8X%t8. . ${RED}|" | |
echo -e "${RED}|${LG} . ${PA}8t% t;;t@88%88:[email protected]@;@;8;@t .%t% ..S;.X@8::St8S :%;8:%S%;88: ${RED}|" | |
echo -e "${RED}|${LG} ${PA}S:88::::8%88%t8.%@%:@8@;%t;X%t8% ;X:; :%888888XStS%%@%X8@88 8t8 . ${RED}|" | |
echo -e "${RED}|${LG} ${PA}8.:X:[email protected];8 .;S8tX.; .SX;; :t; t . S@ X%S;% 8@@8 8%@8% t8;. ${RED}|" | |
echo -e "${RED}|${LG} ${PA}888t${LG}. . . . . . .. . .... .::: :.::; :; .. :; . ${RED}|" | |
echo -e "${RED}|${LG} ${PA}88:${LG}. . . . . . . .. .. . ... . . ${RED}|" | |
echo -e "${RED}|${LG} . . . . . . . . . . . . . . . . . ${RED}|" | |
echo -e "${RED}|${LG} . . . . ${NC}Powered by ${YEL}PANTECH WORLD ${LG}. . . . . . . ${RED}|" | |
echo -e "${RED}|${LG} . . . . . . ${GRE}By ahiSKY under GPLv3${LG} . . . . . . . . . .${RED}|" | |
echo -e "${RED}|${LG} . . . . . . . .. . . . . . . . . . . . . . . .${RED}|" | |
echo -e "${RED}---------------------------------------------------------------------------" | |
echo -e "\n${YEL}iPanhect-Downloader v1 for BASH${NC}" | |
echo -e "To start iPH-Downloader, press ${YEL}ANY${NC} key. If you want to quit, press ${YEL}CTRL+C${NC}." | |
read -n 1 -p "iPH: Your option:" | |
echo -e "${GRE}iPH${NC}: Init in $IPH_INITIME" | |
echo -e "${GRE}iPH${NC}: Creating target DIRs" | |
mkdir pantech-firmware | |
mkdir pantech-oss | |
echo -e "${GRE}iPH${NC}: iPH is now going to init the download of pantech-oss.${YEL}" | |
read -n 1 -p "This is going to take about 20GB of space on your local disk. Press ANY key to continue." | |
echo -e "${GRE}iPH${NC}: Now initiate DL1 - pantech-oss${YEL}" | |
wget -r -np -R "index.html*" $IPH_SITE_PROT/pantech-oss/ --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36" -w $IPH_WAITTIME --directory-prefix=./pantech-oss/ | |
echo -e "${GRE}iPH${NC}: Done downloading pantech-oss!" | |
echo -e "${GRE}iPH${NC}: Moving files to correct directory." | |
mv $IPH_PRGROOT/pantech-oss/$IPH_SITE/pantech-oss/* $IPH_PRGROOT/pantech-oss/ | |
echo -e "${GRE}iPH${NC}: Done moving OSS file locations!" | |
echo -e "${GRE}iPH${NC}: Start checking file integrity." | |
cd pantech-oss | |
sha512sum -c sha512sums.txt | |
cd .. | |
echo -e "${GRE}iPH${NC}: Checking finished." | |
################### DL1 finish | |
echo -e "${GRE}iPH${NC}: iPH is now going to init the download of pantech-firmware.${YEL}" | |
read -n 1 -p "This is going to take about 46GB of space on your local disk. Press ANY key to continue." | |
echo -e "${GRE}iPH${NC}: Now initiate DL2 - pantech-firmware${YEL}" | |
wget -r -np -R "index.html*" $IPH_SITE_PROT/pantech-firmware/ --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36" -w $IPH_WAITTIME --directory-prefix=./pantech-firmware/ | |
echo -e "${GRE}iPH${NC}: Done downloading pantech-firmware!" | |
echo -e "${GRE}iPH${NC}: Moving files to correct directory." | |
mv $IPH_PRGROOT/pantech-firmware/$IPH_SITE/pantech-firmware/* $IPH_PRGROOT/pantech-firmware/ | |
echo -e "${GRE}iPH${NC}: Done moving FW file locations!" | |
echo -e "${GRE}iPH${NC}: Start checking file integrity." | |
cd pantech-firmware | |
sha512sum -c sha512sums.txt | |
cd .. | |
echo -e "${GRE}iPH${NC}: Checking finished." | |
echo -e "${GRE}iPH${NC}: Download has finished. - Now, we will remove junk files created." | |
rm -rf ./pantech-oss/$IPH_SITE | |
rm -rf ./pantech-firmware/$IPH_SITE | |
echo -e "${GRE}iPH${NC}: Junk file removal succeeded." | |
export IPH_ENDTIME=$(date) | |
echo -e "${YEL}iPanhect script ended." | |
echo -e "${GRE}iPH START TIME ${NC}- ${PUR}$IPH_INITIME" | |
echo -e "${GRE}iPH END TIME ${NC}- ${PUR}$IPH_ENDTIME" | |
exit | |
echo -e "${YEL}Thanks for using. Please report bugs on Github." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment