aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel <lionel.miquel46@gmail.com>2018-11-05 14:36:26 +0100
committerLionel <lionel.miquel46@gmail.com>2018-11-05 14:36:26 +0100
commitbe29eb5f23294cd56ac9491099fc74beb4213ccd (patch)
tree2eeb413f4d03ab75dbd4a0c4c921fc20c8db019f
parentebfe9319ee873d18e2575a1f2d98d56fbf76368e (diff)
downloadrandopitons-be29eb5f23294cd56ac9491099fc74beb4213ccd.tar.gz
randopitons-be29eb5f23294cd56ac9491099fc74beb4213ccd.zip
Corrected some errors in my code
-rw-r--r--randopitons.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/randopitons.sh b/randopitons.sh
index fdc7f5e..785f475 100644
--- a/randopitons.sh
+++ b/randopitons.sh
@@ -23,14 +23,16 @@ _download()
{
while read linefromfile; do
- mkdir "${linefromfile}"
- cd "${linefromfile}"
+ mkdir -p ${__dir}/randopfiles/"${linefromfile}"
+ cd ${__dir}/randopfiles/"${linefromfile}"
WEBREGION=$(echo ${linefromfile} | sed 's/ de /\-/g' | tr '[:upper:]' '[:lower:]')
FILENBRS=$(wget -qO- https://randopitons.re/randonnees/region/${WEBREGION} | grep "<tr rid" | cut -d \" -f2)
for nbr in $FILENBRS;do
- wget --content-disposition --load-cookies ${__dir}/cookiejar.txt "https://randopitons.re/randonnee/${nbr}/trace/${MAPTYPE}"
+ # you can change the delay for the -w option. I'm not held responsible for any DDoS complaints.
+ wget -w 2 --content-disposition --load-cookies ${__dir}/cookiejar.txt "https://randopitons.re/randonnee/${nbr}/trace/${MAPTYPE}"
done
- done <${__dir}/$1.txt
+ cd ..
+ done <$1
}
_help()
@@ -82,7 +84,7 @@ _CURRENTREGIONMD5=$(md5sum $REGIONFILE)
echo $_ORIGREGIONMD5 > /tmp/regionshash.txt
if [ -s $REGIONFILE ];then
echo "Region file is already there. OK"
-elif [ "$_CURRENTREGIONMD5" != "$_ORIGREGIONMD5" ]
+elif [ "$_CURRENTREGIONMD5" != "$_ORIGREGIONMD5" ];then
_crearegfile
else
_crearegfile
@@ -146,7 +148,7 @@ while [ "$1" != "" ]; do
-em | --elevator-music )
echo "Initiating elevator music"
- mpv --no-audio --really-quiet "https://www.youtube.com/watch?v=KfNXGY9O5VY" & || echo -e "\nmpv is not installed."
+ mpv --no-audio --really-quiet https://www.youtube.com/watch?v=KfNXGY9O5VY || echo -e "\nmpv is not installed."
;;
-h | --help )