aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel <lionel.miquel46@gmail.com>2018-10-21 18:02:36 +0200
committerLionel <lionel.miquel46@gmail.com>2018-10-21 18:02:36 +0200
commit234ef973d62043f978a5dc23eb262a90bd3991fa (patch)
tree02770883de1689797fe75b6d287cc950043e05e4
parentb3ee49d174a35bbf4da6b1c60059795fdb88f710 (diff)
downloadrandopitons-234ef973d62043f978a5dc23eb262a90bd3991fa.tar.gz
randopitons-234ef973d62043f978a5dc23eb262a90bd3991fa.zip
Making progress. Added the creation of regions.txt and webregions.txt if empty or non-existent.
-rw-r--r--randopitons.sh49
-rw-r--r--randopitons_filecheck.sh16
2 files changed, 59 insertions, 6 deletions
diff --git a/randopitons.sh b/randopitons.sh
index 00f4ef0..0902e17 100644
--- a/randopitons.sh
+++ b/randopitons.sh
@@ -3,6 +3,7 @@
RS="\e[0m" # reset
HC="\e[1m" # hicolor
UL="\e[4m" # underline
+BLNK='\e[5m' #Blink (wtf)
INV="\e[7m" # inverse background and foreground
FBLK="\e[30m" # foreground black
FRED="\e[31m" # foreground red
@@ -38,11 +39,44 @@ ${BLD}MAPTYPE FORMAT:$RS gpx, trk or kml"
credentials()
{
RDPUSER=$1
-echo -e "\nYour username is $RDPUSER."
+echo -e "\nYour username is $RDPUSER. (You can press CTRL+C if this info is incorrect."
echo -e "\nPassword (for randopitons.re): "
read -s RDPUSERPASS
}
+filechecks()
+{
+ 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
+ fi
+
+ 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
+ fi
+}
MAPTYPE="gpx"
RDPHOME=$HOME"/Randopitons"
@@ -63,19 +97,22 @@ while [ "$1" != "" ]; do
-mp | --maptype )
shift
- MAPTYPE=$1
- echo -e "\nChosen maptype is $1"
+ MAPTYPE=$1cl
while [ $MAPTYPE != "gpx" -a $MAPTYPE != "trk" -a $MAPTYPE != "kml" ]
do
- echo -e $HC$BRED"${FYEL}\nMaptype supplied is not correct$RS"
+ echo -e $BLNK$HC$BRED"${FYEL}\nMaptype supplied is not correct$RS"
echo -e "Which map filetype you want to set : ${BLD}gpx(default),trk or kml ?$RS$RS$RS"
read -N 3 MAPTYPE
done
- echo -e $HC$FGRN"\n$MAPTYPE maptype is a valid choice !"$RS
+ echo -e $HC$FGRN"\nThe $MAPTYPE maptype is a valid choice !"$RS
;;
+ -r | --region )
+ shift
+
-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"
+ 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
;;
diff --git a/randopitons_filecheck.sh b/randopitons_filecheck.sh
new file mode 100644
index 0000000..950bdeb
--- /dev/null
+++ b/randopitons_filecheck.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+if [ -s "./regions.txt" ];then
+ "Region file is already there. OK"
+else
+ echo "Cirque de Cilaos
+Cirque de Mafate
+Cirque de Salazie
+Est
+Nord
+Ouest
+Sud
+Volcan
+Ailleurs
+All">regions.txt
+fi \ No newline at end of file