Created
October 24, 2017 13:32
-
-
Save themakunga/bc7f793cb7242185236036e06b457f42 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 | |
megadl=/usr/local/bin/megadl | |
list=$1 | |
clear | |
if [ ! -f $megadl ];then | |
echo -e "error!: no se encuentra instalacion de megadl\nFavor bajar desde https://github.com/megous/megatools" | |
exit 2 | |
fi | |
if [ ! -f $list ];then | |
echo -e "error!: no se ha designado archivo con lista, favor incluir" | |
exit 2 | |
fi | |
clear | |
merro='509' | |
baja(){ | |
local link=$1 | |
ret=$((${megadl} $link)2>&1) | |
} | |
espera(){ | |
x=0 | |
while [[ $x -lt 300 ]]; do | |
clear | |
echo espere $x segundos | |
done | |
} | |
while read -r line | |
do | |
baja $line | |
if $(echo "$ret" | grep -q -i "$merro"); then | |
echo "espera" | |
espera | |
else | |
echo "ok" | |
fi | |
ret="" | |
done < $list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment