LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File start-samba-on-fileshare.diff of Package kdenetwork3 (Project openSUSE:Factory)

Index: filesharing/simple/fileshare.cpp
================================================================================
--- filesharing/simple/fileshare.cpp
+++ filesharing/simple/fileshare.cpp
@@ -335,6 +335,22 @@
     stream << m_smbConf;
     
     file.close();
+
+    if ( m_ccgui->shareGrp->isChecked() ) {
+       KProcess insserv;
+       insserv << "/sbin/insserv" << "nmb";
+       insserv.start(KProcess::Block);
+       insserv << "/sbin/insserv" << "smb";
+       insserv.start(KProcess::Block);
+
+       KProcess nmb;
+       nmb << "/etc/init.d/nmb" << "start";
+       if(!nmb.start(KProcess::Block) && nmb.normalExit()) {
+          KProcess smb;
+          smb << "/etc/init.d/smb" << "start";
+          smb.start(KProcess::Block);
+       }
+    }
 }
 
 void KFileShareConfig::defaults()