[PC-BSD Commits] r182 - in pcbsd/trunk: PBCsource PBIsource
svn at pcbsd.org
svn at pcbsd.org
Wed Apr 18 18:18:07 PDT 2007
Author: kris
Date: 2007-04-19 02:18:07 +0100 (Thu, 19 Apr 2007)
New Revision: 182
Modified:
pcbsd/trunk/PBCsource/pbistart.c
pcbsd/trunk/PBIsource/pbi.ui.h
Log:
Added a few fixes to launching a program at close
Modified: pcbsd/trunk/PBCsource/pbistart.c
===================================================================
--- pcbsd/trunk/PBCsource/pbistart.c 2007-04-19 00:53:10 UTC (rev 181)
+++ pcbsd/trunk/PBCsource/pbistart.c 2007-04-19 01:18:07 UTC (rev 182)
@@ -374,8 +374,23 @@
}
}
+/* Run the postClose.sh script, if it exists on the system */
+char postcmd[200];
+strcpy(postcmd, pbitmpdir);
+strcat(postcmd, "/postClose.sh");
+FILE *fp = fopen(postcmd,"r");
+if( fp ) {
+// exists
+fclose(fp);
+
+system(postcmd);
+
+}
+
+
+
/* Remove the temp files & dirs */
char rmcmd[200];
Modified: pcbsd/trunk/PBIsource/pbi.ui.h
===================================================================
--- pcbsd/trunk/PBIsource/pbi.ui.h 2007-04-19 00:53:10 UTC (rev 181)
+++ pcbsd/trunk/PBIsource/pbi.ui.h 2007-04-19 01:18:07 UTC (rev 182)
@@ -1902,8 +1902,14 @@
if ( checkLaunch->isChecked() )
{
- system("su -c " + RealUserName + " " + RealUserName + " -c '" + LaunchClose + "' &" );
- sleep(2);
+ QFile file( "postClose.sh" );
+ if ( file.open( IO_WriteOnly ) ) {
+ QTextStream stream( &file );
+ stream << "#!/bin/sh\n" + LaunchClose + "&";
+ file.close();
+ }
+ system("chmod 755 postClose.sh" );
+
}
exit(0);
More information about the Commits
mailing list