1 |
On 29 July 2006 10:20, 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 |
nohup your_script & |
24 |
|
25 |
The ssh connection will still be interrupted but the script will finish. |
26 |
|
27 |
Uwe |
28 |
|
29 |
-- |
30 |
Mark Twain: I rather decline two drinks than a German adjective. |
31 |
http://www.SysEx.com.na |
32 |
-- |
33 |
gentoo-user@g.o mailing list |