From owner-freebsd-questions@FreeBSD.ORG Mon Feb 10 21:33:41 2014 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F96880B; Mon, 10 Feb 2014 21:33:41 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 22EF21B81; Mon, 10 Feb 2014 21:33:40 +0000 (UTC) Received: from smarthost.fisglobal.com ([10.132.206.192]) by ltcfislmsgpa07.fnfis.com (8.14.5/8.14.5) with ESMTP id s1ALXbTj012318 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 10 Feb 2014 15:33:37 -0600 Received: from THEMADHATTER (10.242.181.54) by smarthost.fisglobal.com (10.132.206.192) with Microsoft SMTP Server id 14.3.174.1; Mon, 10 Feb 2014 15:33:35 -0600 From: Sender: Devin Teske To: "'Juergen Nickelsen'" , , "'Vladislav Prodan'" , "'Darren Pilgrim'" References: <1391822758.499117562.qad9aups@frv35.fwdcdn.com> <20140208102029.04d2eb10@X220.alogt.com> <1391827303.738906888.k9hzy6eo@frv35.fwdcdn.com> <52F5BF3A.2030500@bluerosetech.com> <1391864386.931739885.x8t44ikc@frv35.fwdcdn.com> <0b7f01cf267d$72ac84b0$58058e10$@FreeBSD.org> <52F90263.5010006@w21.org> In-Reply-To: <52F90263.5010006@w21.org> Subject: RE: Restart network without reboot ? Date: Mon, 10 Feb 2014 13:33:28 -0800 Message-ID: <0c5801cf26a7$be6ea570$3b4bf050$@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQGNiSH3bPbBYJBfkVvjdHchVVu/bQGZ8AI4AWdW7u0DUXpHEAG7QZ44AWDI9lgCdisREJrTFVow Content-Language: en-us X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.87, 1.0.14, 0.0.0000 definitions=2014-02-10_04:2014-02-10,2014-02-10,1970-01-01 signatures=0 X-Mailman-Approved-At: Mon, 10 Feb 2014 22:00:13 +0000 Cc: 'Erich Dollansky' , questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Feb 2014 21:33:41 -0000 > -----Original Message----- > From: Juergen Nickelsen [mailto:ni@w21.org] > Sent: Monday, February 10, 2014 8:46 AM > To: dteske@FreeBSD.org; 'Vladislav Prodan'; 'Darren Pilgrim' > Cc: 'Erich Dollansky'; questions@freebsd.org > Subject: Re: Restart network without reboot ? > > On 10.02.2014 17:30, dteske@FreeBSD.org wrote: > > $ cat << EOF > /tmp/do_it_now.sh > > #!/bin/sh > > service netif restart > > dhclient em0 > > dhclient em1 > > EOF > > > > Then add a line to your /etc/crontab that will fire in the next 1-2 > > minutes... > > > > sh -c 'echo "$((($(date +%M)+2)%60)) $(date +%H) * * * root sh > > /tmp/do_it_now.sh" >> /etc/crontab' > > > > NB: That's a single command to be entered on a single line > > > > Then just wait a minute or two, you'll get kicked out, start a ping, > > and when it starts responding on the new IP address (hopefully you > > know what this is) you can log in on the new address. > > > > Of course, the next thing you should do is to edit /etc/crontab to > > remove the entry else the same time tomorrow it will reset your > > network. > > > > Lastly, remove the /tmp/do_it_now.sh script. > > Is there any special reason you don't just > > $ echo 'service netif restart; dhclient em0; dhclient em1' | at now > > , which looks so much easier to me? > > Of course, at(1) drags your whole environment into the job, which may be > not what you want. I wouldn't see much harm in this case, though. > [Devin Teske] Thanks for the tip; I'll try that next time. -- Devin _____________ The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.