From 62eb31862a998b198c0bf19f4cc3db92a3aea00b Mon Sep 17 00:00:00 2001 From: Lionel Date: Mon, 22 Oct 2018 00:13:46 +0200 Subject: Fixed bad indents in the creation of the default files (regions.txt and webregions.txt). Still experimentating about the command line arguments. --- randopitons.sh | 42 ++++++++++++++---------------------------- webregions.txt | 10 +--------- 2 files changed, 15 insertions(+), 37 deletions(-) diff --git a/randopitons.sh b/randopitons.sh index 8d2c4ec..2373fbd 100644 --- a/randopitons.sh +++ b/randopitons.sh @@ -47,32 +47,15 @@ read -s RDPUSERPASS if [ -s "./regions.txt" ];then echo "Region file is already there. OK" else - echo "Region file isn't. Not OK, we will create it." - echo "Cirque de Cilaos - Cirque de Mafate - Cirque de Salazie - Est - Nord - Ouest - Sud - Volcan - Ailleurs - All">regions.txt + echo "Region file doesn't exist, we will create it." + echo -e "Cirque de Cilaos\nCirque de Mafate\nCirque de Salazie\nEst\nNord\nOuest\nSud\nVolcan\nAilleurs\nAll">regions.txt fi -if [-s "./webregions.txt"];then +if [ -s "./webregions.txt" ];then echo "Webegion file is already there. OK" else - echo "Wegion file isn't. Not OK, we will create it." - echo "cirque-cilaos - cirque-mafate - cirque-salazie - est - nord - ouest - sud - volcan - ailleurs">webregions.txt + echo "Webregion file doesn't exist, we will create it." + echo -e "cirque-cilaos\ncirque-mafate\ncirque-salazie\nest\nnord\nouest\nsud\nvolcan\nailleurs">webregions.txt fi MAPTYPE="gpx" @@ -105,15 +88,18 @@ while [ "$1" != "" ]; do ;; -r | --region ) shift - + matching=`grep -iE "$1" regions.txt` + webmatching=`grep -iE "$1" webregions.txt` + if [ "$1" != "" ];then + echo -e "Your region choice was '$1'\n See what matched :" + else + echo -e $HC$FCYN"$matching"$RS + fi + ;; -a | --all ) - echo -e "\nThis will download all the hitchiking routes from all regions." - echo -e "\nIf no maptype is specified (with -mp or --maptype), it will default to .gpx filetype.\n${BLD}Pausing for 5 seconds before launching it.$RS" - purerage + echo -e "\nThis will download all the hitchiking routes from all regions.\nIf no maptype is specified (with -mp or --maptype), it will default to .gpx filetype.\n${BLD}Pausing for 5 seconds before launching it.$RS" ;; - - # -h | --help ) tellusage # exit # ;; diff --git a/webregions.txt b/webregions.txt index 6a45d63..ccdf539 100644 --- a/webregions.txt +++ b/webregions.txt @@ -1,9 +1 @@ -cirque-cilaos -cirque-mafate -cirque-salazie -est -nord -ouest -sud -volcan -ailleurs \ No newline at end of file +cirque-cilaos\ncirque-mafate\ncirque-salazie\nest\nnord\nouest\nsud\nvolcan\nailleurs -- cgit v1.2.3-54-g00ecf