Diffstat (limited to 'noncore/settings/networksettings2/network') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/network/networkrun.cpp | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/noncore/settings/networksettings2/network/networkrun.cpp b/noncore/settings/networksettings2/network/networkrun.cpp index c17aa7f..2c93d9d 100644 --- a/noncore/settings/networksettings2/network/networkrun.cpp +++ b/noncore/settings/networksettings2/network/networkrun.cpp | |||
@@ -23,29 +23,28 @@ QString NetworkRun::setMyState( NodeCollection * NC, Action_t A, bool ) { | |||
23 | InterfaceInfo * II = NC->assignedInterface(); | 23 | InterfaceInfo * II = NC->assignedInterface(); |
24 | 24 | ||
25 | if( ! II ) { | ||
26 | Log(( "no interface assigned." )); | ||
27 | return QString(); | ||
28 | } | ||
29 | |||
30 | QStringList SL; | ||
31 | |||
25 | if( A == Up ) { | 32 | if( A == Up ) { |
26 | // we can bring UP if lower level is available | 33 | // we can bring UP if lower level is available |
27 | QStringList SL; | 34 | SL << "ifup"; |
28 | SL << "ifup" | 35 | } else if( A == Down ) { |
29 | << QString().sprintf( "%s=%s-c%d-allowed", | 36 | SL << "ifdown"; |
37 | } else { | ||
38 | return QString(); | ||
39 | } | ||
40 | |||
41 | SL << QString().sprintf( "%s=%s-c%d-allowed", | ||
30 | II->Name.latin1(), II->Name.latin1(), | 42 | II->Name.latin1(), II->Name.latin1(), |
31 | nodeCollection()->number() ); | 43 | nodeCollection()->number() ); |
32 | if( ! NSResources->system().runAsRoot( SL ) ) { | 44 | |
33 | return QString("Cannot call %1").arg(SL.join(" ")); | 45 | if( ! NSResources->system().runAsRoot( SL ) ) { |
34 | } | 46 | return QString("Cannot call %1").arg(SL.join(" ")); |
35 | return QString(); | 47 | } |
36 | } | 48 | |
37 | |||
38 | if( A == Down ) { | ||
39 | QStringList SL; | ||
40 | if( II ) { | ||
41 | SL << "ifdown" | ||
42 | << II->Name.latin1(); | ||
43 | if( ! NSResources->system().runAsRoot( SL ) ) { | ||
44 | return QString( "Cannot call %1" ).arg( SL.join( " " )); | ||
45 | } | ||
46 | } else { | ||
47 | Log(( "no interface assigned." )); | ||
48 | } | ||
49 | } | ||
50 | return QString(); | 49 | return QString(); |
51 | } | 50 | } |