Gentoo Archives: gentoo-user

From: Todor Pirov <refract@××××.org>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Restart network interfaces over SSH
Date: Sat, 29 Jul 2006 09:23:36
Message-Id: 200607291220.02825.refract@9mhz.org
1 Hello,
2 I have the following script which exchanges the IPs of two network adapters:
3
4 [code]
5 #!/bin/bash
6
7 /usr/bin/cp /etc/conf.d/net-2 /etc/conf.d/net;
8 /etc/init.d/net.eth1 stop;
9 /etc/init.d/net.eth0 restart;
10 /etc/init.d/net.eth1 start
11 [/code]
12
13 and a similar one with "/usr/bin/cp /etc/conf.d/net-1 /etc/conf.d/net;" in it
14 to restore the original situation. In net-1 and net-2 config files the IPs of
15 eth0 and eth1 are substituted.
16 The problem is that when I run the script from eth1 via SSH it stops executing
17 when the interface stops. If it is ran from eth0 it executes normally.
18 Is there a way to tell bash not to stop executing commands if connection is
19 broken or some more convenient gentoo-style way to exchange the IPs from SSH.
20 TIA
21
22 Todor
23 --
24 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Restart network interfaces over SSH Raymond Lewis Rebbeck <dystopianray@×××××.com>
Re: [gentoo-user] Restart network interfaces over SSH Uwe Thiem <uwix@××××.na>