aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel <lionel.miquel46@gmail.com>2018-10-22 00:13:46 +0200
committerLionel <lionel.miquel46@gmail.com>2018-10-22 00:13:46 +0200
commit62eb31862a998b198c0bf19f4cc3db92a3aea00b (patch)
tree1e299805117b77ef9dc7aa4c5981e4df405b4ffa
parent3789161d85d2ad54279077b0123ccec6aec619e5 (diff)
downloadrandopitons-62eb31862a998b198c0bf19f4cc3db92a3aea00b.tar.gz
randopitons-62eb31862a998b198c0bf19f4cc3db92a3aea00b.zip
Fixed bad indents in the creation of the default files (regions.txt and webregions.txt). Still experimentating about the command line arguments.
-rw-r--r--randopitons.sh42
-rw-r--r--webregions.txt10
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