Created
October 10, 2016 08:30
-
-
Save melmi/bc96a16b77238702a3a534fe3927dd31 to your computer and use it in GitHub Desktop.
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 | |
cd ~/Downloads/auto/ | |
echo "============================" >> log.txt | |
echo "[$(date)] script launched" >> log.txt | |
echo "[$(date)] renewing dllist.txt" >> log.txt | |
rm dllist.txt | |
wget --user=folani --password=passwordesh melmi.ir/downloads/dllist.txt | |
echo "[$(date)] creating active.txt" >> log.txt | |
comm dllist.txt done.txt -23 --nocheck-order > active.txt | |
while [ -s active.txt ] | |
do | |
echo "[$(date)] starting download" >> log.txt | |
head -n 1 active.txt >> log.txt | |
head -n 1 active.txt | sed -e's/%\([0-9A-F][0-9A-F]\)/\\\\\x\1/g' | xargs echo -e | xargs -I {} wget -c "{}" | |
echo "[$(date)] finished" >> log.txt | |
head -n 1 active.txt >> done.txt | |
tail -n +2 active.txt > tmp.txt | |
mv tmp.txt active.txt | |
done | |
echo "[$(date)] script finished." >> log.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment