Created
March 2, 2018 07:05
-
-
Save mostafaasadi/6252b3eb150a92cd97fdf92018317907 to your computer and use it in GitHub Desktop.
A download manager has written in scu linux class
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
#!/usr/bin/env bash | |
clear | |
# pre-text | |
echo -e "\n\t\tIn the name of Allah" | |
echo -e "\t\t wellcome to download manager" | |
# get link | |
read -p "link: " link | |
# get start hour | |
read -p "start hour: " sh | |
# get start minute | |
read -p "start minute: " sm | |
# text | |
echo -e "\n\t your download will start at $sh : $sm" | |
# get now tine | |
nh=`date +%-I` | |
nm=`date +%-M` | |
sigma_st=$((sh*60+sm)) | |
sigma_nt=$((nh*60+nm)) | |
echo -e "\n\t wating ..." | |
while [[ $sigma_nt != $sigma_st ]]; do | |
sleep 3 | |
nh=`date +%-I` | |
nm=`date +%-M` | |
sigma_nt=$((nh*60+nm)) | |
done | |
echo -e "\n\t Download start ... " | |
wget $link |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment