aboutsummaryrefslogtreecommitdiff
path: root/brweather/bin/seasons
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-02-14 16:28:47 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-02-14 16:28:47 -0200
commit68056a2399b2477f04beba4937ba680c19b98a52 (patch)
tree92ec092658d5e2bbff0af5d3db0388ae6dba1bd0 /brweather/bin/seasons
parent55b0ec02e45fbfd1ec86de78ceeccd2fb5a07fd0 (diff)
downloadbrweather-68056a2399b2477f04beba4937ba680c19b98a52.tar.gz
brweather-68056a2399b2477f04beba4937ba680c19b98a52.tar.bz2
Using relative paths again
Diffstat (limited to 'brweather/bin/seasons')
-rw-r--r--brweather/bin/seasons35
1 files changed, 19 insertions, 16 deletions
diff --git a/brweather/bin/seasons b/brweather/bin/seasons
index 2b500f3..b4adf4e 100644
--- a/brweather/bin/seasons
+++ b/brweather/bin/seasons
@@ -6,28 +6,31 @@
# http://brweatherproject.blogspot.com/
# Distribuído sob licença GPLv3
+# Pasta base
+DIRNAME="$(dirname `dirname $0`)"
+
YEAR=`date +%Y`
DATA0=`date +%d`
##Outono
-OUTD=`cat /opt/brweather/doc/seasons | grep $YEAR | cut -f2 -d'#'`
-OUTH=`cat /opt/brweather/doc/seasons | grep $YEAR | cut -f3 -d'#'`
+OUTD=`cat $DIRNAME/doc/seasons | grep $YEAR | cut -f2 -d'#'`
+OUTH=`cat $DIRNAME/doc/seasons | grep $YEAR | cut -f3 -d'#'`
##Inverno
-INVD=`cat /opt/brweather/doc/seasons | grep $YEAR | cut -f4 -d'#'`
-INVH=`cat /opt/brweather/doc/seasons | grep $YEAR | cut -f5 -d'#'`
+INVD=`cat $DIRNAME/doc/seasons | grep $YEAR | cut -f4 -d'#'`
+INVH=`cat $DIRNAME/doc/seasons | grep $YEAR | cut -f5 -d'#'`
##Primavera
-PRID=`cat /opt/brweather/doc/seasons | grep $YEAR | cut -f6 -d'#'`
-PRIH=`cat /opt/brweather/doc/seasons | grep $YEAR | cut -f7 -d'#'`
+PRID=`cat $DIRNAME/doc/seasons | grep $YEAR | cut -f6 -d'#'`
+PRIH=`cat $DIRNAME/doc/seasons | grep $YEAR | cut -f7 -d'#'`
##Verão
-VERD=`cat /opt/brweather/doc/seasons | grep $YEAR | cut -f8 -d'#'`
-VERH=`cat /opt/brweather/doc/seasons | grep $YEAR | cut -f9 -d'#'`
+VERD=`cat $DIRNAME/doc/seasons | grep $YEAR | cut -f8 -d'#'`
+VERH=`cat $DIRNAME/doc/seasons | grep $YEAR | cut -f9 -d'#'`
##Funções
function MAR(){
-DATA1=`cat /opt/brweather/doc/seasons | grep $YEAR | cut -f2 -d'#' | cut -f1 -d' '`
+DATA1=`cat $DIRNAME/doc/seasons | grep $YEAR | cut -f2 -d'#' | cut -f1 -d' '`
HORA0=`date +%R | sed s/://g`
-HORA1=`cat /opt/brweather/doc/seasons | grep $YEAR | cut -f3 -d'#' | sed s/://g`
+HORA1=`cat $DIRNAME/doc/seasons | grep $YEAR | cut -f3 -d'#' | sed s/://g`
if [ $DATA0 -lt $DATA1 ]
then
SEASON1="Ver"
@@ -125,9 +128,9 @@ fi
}
function JUN(){
-DATA1=`cat /opt/brweather/doc/seasons | grep $YEAR | cut -f4 -d'#' | cut -f1 -d' '`
+DATA1=`cat $DIRNAME/doc/seasons | grep $YEAR | cut -f4 -d'#' | cut -f1 -d' '`
HORA0=`date +%R | sed s/://g`
-HORA1=`cat /opt/brweather/doc/seasons | grep $YEAR | cut -f5 -d'#' | sed s/://g`
+HORA1=`cat $DIRNAME/doc/seasons | grep $YEAR | cut -f5 -d'#' | sed s/://g`
if [ $DATA0 -lt $DATA1 ]
then
SEASON1="Out"
@@ -225,9 +228,9 @@ fi
}
function SET(){
-DATA1=`cat /opt/brweather/doc/seasons | grep $YEAR | cut -f6 -d'#' | cut -f1 -d' '`
+DATA1=`cat $DIRNAME/doc/seasons | grep $YEAR | cut -f6 -d'#' | cut -f1 -d' '`
HORA0=`date +%R | sed s/://g`
-HORA1=`cat /opt/brweather/doc/seasons | grep $YEAR | cut -f7 -d'#' | sed s/://g`
+HORA1=`cat $DIRNAME/doc/seasons | grep $YEAR | cut -f7 -d'#' | sed s/://g`
if [ $DATA0 -lt $DATA1 ]
then
SEASON1="Inv"
@@ -325,9 +328,9 @@ fi
}
function DEZ(){
-DATA1=`cat /opt/brweather/doc/seasons | grep $YEAR | cut -f8 -d'#' | cut -f1 -d' '`
+DATA1=`cat $DIRNAME/doc/seasons | grep $YEAR | cut -f8 -d'#' | cut -f1 -d' '`
HORA0=`date +%R | sed s/://g`
-HORA1=`cat /opt/brweather/doc/seasons | grep $YEAR | cut -f9 -d'#' | sed s/://g`
+HORA1=`cat $DIRNAME/doc/seasons | grep $YEAR | cut -f9 -d'#' | sed s/://g`
if [ $DATA0 -lt $DATA1 ]
then
SEASON1="Pri"