From owner-freebsd-questions@FreeBSD.ORG Mon Feb 10 16:46:33 2014 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EAEF4FB2; Mon, 10 Feb 2014 16:46:33 +0000 (UTC) Received: from w21.org (ribe.w21.org [IPv6:2a01:238:4382:a300:3fe5:41ce:8574:8378]) by mx1.freebsd.org (Postfix) with ESMTP id A33101FE3; Mon, 10 Feb 2014 16:46:33 +0000 (UTC) Received: from [130.133.10.14] (bermuda.zedat.fu-berlin.de [130.133.10.14]) by w21.org (Postfix) with ESMTPSA id 43AD91D04297; Mon, 10 Feb 2014 17:46:32 +0100 (CET) Message-ID: <52F90263.5010006@w21.org> Date: Mon, 10 Feb 2014 17:46:27 +0100 From: Juergen Nickelsen Organization: W21 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: dteske@FreeBSD.org, 'Vladislav Prodan' , 'Darren Pilgrim' Subject: Re: Restart network without reboot ? 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> In-Reply-To: <0b7f01cf267d$72ac84b0$58058e10$@FreeBSD.org> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SD6FUb7STbVIH2A3bTEwBHpX33WLjr2BR" 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 16:46:34 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SD6FUb7STbVIH2A3bTEwBHpX33WLjr2BR Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 >=20 > Then add a line to your /etc/crontab that will fire in the next 1-2 > minutes... >=20 > sh -c 'echo "$((($(date +%M)+2)%60)) $(date +%H) * * * root sh > /tmp/do_it_now.sh" >> /etc/crontab' >=20 > NB: That's a single command to be entered on a single line >=20 > Then just wait a minute or two, you'll get kicked out, start a ping, an= d > when > it starts responding on the new IP address (hopefully you know what thi= s is) > you can log in on the new address. >=20 > Of course, the next thing you should do is to edit /etc/crontab to remo= ve > the > entry else the same time tomorrow it will reset your network. >=20 > 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. Regards, Juergen. --SD6FUb7STbVIH2A3bTEwBHpX33WLjr2BR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJS+QJjAAoJEEb28HuG6YEftjUH/Rzjuv3mJqlemfboqFwhOVp0 YAE4uyo8Lw4zTDgBRUDD4GiKliqiIYFoivIIDZKHR5VkWUqgJLoHLOANRNo1ycz3 J18MSMP2DxiZR4ISYWUW/2SSt1lLJW8DnQRKC2DkwxNaaMjDARDlMKKoC9Er0LeH UsnW9VZ2HZncXJekM7puM4jkx8Pr7wdQ8GQHo5Xv74soXz+IhbfVY9Bff5G7vBtS XKmhpJcWoWDbcTR8OcBEOFYA8/rWIY/oDqaTvUkAOQ6ZqNr1dxAng83FfzoswBHu 7gmEpWa/lisNSFznqicFyC97mVUcwu145UxlRAnhkhc1T/j/z7W/b7Q86duid/w= =jcTV -----END PGP SIGNATURE----- --SD6FUb7STbVIH2A3bTEwBHpX33WLjr2BR--