Bash:

#!/bin/bash -x




On 11/12/2013 10:50 AM, Jake Vath wrote:
> Are you trying to run this as a Bash script with /#!/bin/bash/ (or 
> some from of Bash)?
> or are you trying to run this as a Bourne shell with /#!/bin/sh/ (or 
> some form of Borne)?
>
> -> Jake
>
>
> On Tue, Nov 12, 2013 at 9:01 AM, Raymond Norton <admin at lctn.org 
> <mailto:admin at lctn.org>> wrote:
>
>     I run the following script to test if a host is on-line and
>     trigger a back up if it's alive. Something apparently changed with
>     the script and it is giving me a "unary operator expected" error
>     for line 17.
>
>     Any ideas what is triggering it?
>
>
>
>     if [ -f /etc/bacula/ping_check.txt ];
>     then
>          FILEDATE=`cat /etc/bacula/ping_check.txt`
>     else
>          FILEDATE=0
>     fi
>
>     if [ $NOWDATE -ne $FILEDATE ];
>     then
>          if [[ $CMD_RET =~ ", 0% packet loss" ]]
>          then
>               echo "$HOST pinged ..."
>               echo $NOWDATE > /etc/bacula/ping_check.txt
>             # run backup script
>              /etc/bacula/backup-host-1
>
>          else
>               echo "$HOST did not ping ..."
>          fi
>     fi
>
>     exit
>
>     -- 
>     Raymond Norton
>     LCTN
>     952.955.7766 <tel:952.955.7766>
>
>     Sent from My Desktop
>
>     _______________________________________________
>     TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
>     tclug-list at mn-linux.org <mailto:tclug-list at mn-linux.org>
>     http://mailman.mn-linux.org/mailman/listinfo/tclug-list
>
>
>
> -- 
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
> believed to be clean.
>
>
> _______________________________________________
> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
> tclug-list at mn-linux.org
> http://mailman.mn-linux.org/mailman/listinfo/tclug-list

-- 
Raymond Norton
LCTN
952.955.7766

Sent from My Desktop

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20131112/a3b8dae7/attachment-0001.html>