From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1G6lAC-0005zH-4c for garchives@archives.gentoo.org; Sat, 29 Jul 2006 09:31:16 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.7/8.13.6) with SMTP id k6T9TeZ9010061; Sat, 29 Jul 2006 09:29:40 GMT Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.183]) by robin.gentoo.org (8.13.7/8.13.6) with ESMTP id k6T9PWmB026210 for ; Sat, 29 Jul 2006 09:25:33 GMT Received: by py-out-1112.google.com with SMTP id d42so75624pyd for ; Sat, 29 Jul 2006 02:25:32 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=siECyYQpA4IoMLFKtjOlm6I/oAQM1An9q2Rfc6KBbRQdBonRZ0k8JxmHSSfmotpiZXpor1UYfemzn3Y+Swr4TzElNP7qihxkWWx49eWdQGdy551jYS/FCrEG0aWa1+esZq42BJjEV7GYZWcaOCQ19nkA6W+jZkLpzy/7fH1CDjw= Received: by 10.35.128.1 with SMTP id f1mr551094pyn; Sat, 29 Jul 2006 02:25:32 -0700 (PDT) Received: from ymir.donotfeedtheray.com ( [210.0.108.13]) by mx.gmail.com with ESMTP id k13sm2002112pyf.2006.07.29.02.25.31; Sat, 29 Jul 2006 02:25:32 -0700 (PDT) From: Raymond Lewis Rebbeck To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Restart network interfaces over SSH Date: Sat, 29 Jul 2006 18:55:22 +0930 User-Agent: KMail/1.9.1 References: <200607291220.02825.refract@9mhz.org> In-Reply-To: <200607291220.02825.refract@9mhz.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200607291855.23149.dystopianray@gmail.com> X-Archives-Salt: 9674033c-9dc4-4c4a-8247-7518f2aff046 X-Archives-Hash: 239942e79f1bc638a38ba84fea992697 On Saturday, 29 July 2006 18:50, Todor Pirov wrote: > Hello, > I have the following script which exchanges the IPs of two network > adapters: > > [code] > #!/bin/bash > > /usr/bin/cp /etc/conf.d/net-2 /etc/conf.d/net; > /etc/init.d/net.eth1 stop; > /etc/init.d/net.eth0 restart; > /etc/init.d/net.eth1 start > [/code] > > and a similar one with "/usr/bin/cp /etc/conf.d/net-1 /etc/conf.d/net;" in > it to restore the original situation. In net-1 and net-2 config files the > IPs of eth0 and eth1 are substituted. > The problem is that when I run the script from eth1 via SSH it stops > executing when the interface stops. If it is ran from eth0 it executes > normally. Is there a way to tell bash not to stop executing commands if > connection is broken or some more convenient gentoo-style way to exchange > the IPs from SSH. TIA > > Todor How about running the script in a screen session? -- Raymond Lewis Rebbeck -- gentoo-user@gentoo.org mailing list