#!/bin/bash if (ping -c1 -w1 -n wap1); then eval "/usr/local/bin/tide -b \"`date +\"%Y-%m-%d %H:%M\"`\" -e \"`date +\"%Y-%m-%d %H:%M\"`\" -s \"00:05\" -l \"Alert Bay, British Columbia\" -m r -o /var/log/waplog-oct"; else ((echo "`date +"%s "` ") >> /var/log/waplog-oct); fi # this prints the tide value for the current time using the xtide program. # formatted as # 2003-10-01 9:22 AM PDT 8.480982 #eval "/usr/local/bin/tide -b \"`date +\"%Y-%m-%d %l:%M\"`\" -e \"`date +\"%Y-%m-%d %l:%M\"`\" -s \"00:05\" -l \"Alert Bay, British Columbia\" -m m " # Same as previous but appends to a file called junk: #eval "/usr/local/bin/tide -b \"`date +\"%Y-%m-%d %l:%M\"`\" -e \"`date +\"%Y-%m-%d %l:%M\"`\" -s \"00:05\" -l \"Alert Bay, British Columbia\" -m m -o junk" # This has the timeformat -tf command lin switch to set the printed # time format for compatibility with gnuplot's timefmt. #eval "/usr/local/bin/tide -b \"`date +\"%Y-%m-%d %l:%M\"`\" -e \"`date +\"%Y-%m-%d %l:%M\"`\" -s \"00:05\" -l \"Alert Bay, British Columbia\" -m m -tf \"%H:%M\" "