From 68056a2399b2477f04beba4937ba680c19b98a52 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 14 Feb 2013 16:28:47 -0200 Subject: Using relative paths again --- brweather/bin/seasons | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'brweather/bin/seasons') 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" -- cgit v1.2.3