From owner-freebsd-questions@FreeBSD.ORG Wed Aug 29 14:17:38 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7988316A417 for ; Wed, 29 Aug 2007 14:17:38 +0000 (UTC) (envelope-from mnslinky@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.180]) by mx1.freebsd.org (Postfix) with ESMTP id 323B213C442 for ; Wed, 29 Aug 2007 14:17:37 +0000 (UTC) (envelope-from mnslinky@gmail.com) Received: by py-out-1112.google.com with SMTP id u77so2321439pyb for ; Wed, 29 Aug 2007 07:17:35 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:in-reply-to:references:mime-version:x-priority:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=efc+ceT/zsscOpLvrJ4few7l643xHIadhptbkmozqBdF5ugOGH8Z1iX/YJrncqGgcH0dBr0Dq0L9Q10Pyytllq+ut6N62gu34zBi33+gx1J5+xNqM5mEGwUtU4sKZwyL6G88hfXeuQ690+rqCuvkDeptTcXDwuDNcbbedQDZcuc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:in-reply-to:references:mime-version:x-priority:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=SPydnqoSDpsa3kTFh0m2SvjF+DEokWQSC+3dSWED70PGCmk71rZ3Fn+m1LlMQdWTlBTHKg7jBhg5Z7HHN23FtUfJm+eOuiOWTPqPLn9hiBhLW8ikBv+FW8BOA9MMBTP3NwzIdKNI+AsL0J8yvreo7aq7BpqZDfBen3x8/KmI60c= Received: by 10.35.98.3 with SMTP id a3mr887700pym.1188397048530; Wed, 29 Aug 2007 07:17:28 -0700 (PDT) Received: from ?10.0.0.14? ( [74.95.66.25]) by mx.google.com with ESMTPS id x56sm14871004pyg.2007.08.29.07.17.23 (version=SSLv3 cipher=OTHER); Wed, 29 Aug 2007 07:17:24 -0700 (PDT) In-Reply-To: <01a901c7ea3d$0ad62720$1e00a8c0@cheqsoft.local> References: <01a901c7ea3d$0ad62720$1e00a8c0@cheqsoft.local> Mime-Version: 1.0 (Apple Message framework v752.3) X-Priority: 3 Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Eric Crist Date: Wed, 29 Aug 2007 09:17:13 -0500 To: Hinkie X-Mailer: Apple Mail (2.752.3) Cc: freebsd-questions@FreeBSD.ORG Subject: Re: FreeBSD Cron Job to run (ifconfig em0 down; ifconfig em0 up) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2007 14:17:38 -0000 On Aug 29, 2007, at 8:03 AMAug 29, 2007, Hinkie wrote: > Hi > > I want to run a cron job in /etc/crontab that runs (ifconfig em0 > down; ifconfig em0 up) if my cables static ip gateway can't be > pinged but I can't figure it out. I can't get the syntax that runs > in the command window, to then put intot the crontab.... > > Can anyone help me? Here's what I'd use: ping -c 1 a.b.c.d; TESTV=$?; if [ $TESTV != 0 ]; then `ifconfig em0 down`; fi HTH ----- Eric F Crist Secure Computing Networks