1 |
On Saturday, 29 July 2006 18:50, Todor Pirov wrote: |
2 |
> Hello, |
3 |
> I have the following script which exchanges the IPs of two network |
4 |
> adapters: |
5 |
> |
6 |
> [code] |
7 |
> #!/bin/bash |
8 |
> |
9 |
> /usr/bin/cp /etc/conf.d/net-2 /etc/conf.d/net; |
10 |
> /etc/init.d/net.eth1 stop; |
11 |
> /etc/init.d/net.eth0 restart; |
12 |
> /etc/init.d/net.eth1 start |
13 |
> [/code] |
14 |
> |
15 |
> and a similar one with "/usr/bin/cp /etc/conf.d/net-1 /etc/conf.d/net;" in |
16 |
> it to restore the original situation. In net-1 and net-2 config files the |
17 |
> IPs of eth0 and eth1 are substituted. |
18 |
> The problem is that when I run the script from eth1 via SSH it stops |
19 |
> executing when the interface stops. If it is ran from eth0 it executes |
20 |
> normally. Is there a way to tell bash not to stop executing commands if |
21 |
> connection is broken or some more convenient gentoo-style way to exchange |
22 |
> the IPs from SSH. TIA |
23 |
> |
24 |
> Todor |
25 |
|
26 |
How about running the script in a screen session? |
27 |
|
28 |
-- |
29 |
Raymond Lewis Rebbeck |
30 |
-- |
31 |
gentoo-user@g.o mailing list |