Difference between revisions of "Rp"

From Organic Design wiki
(using exec instead of qx fixes the not-returning issue)
(new "rp" which is in init.d)
Line 1: Line 1:
 
#!/usr/bin/perl
 
#!/usr/bin/perl
for ( split /\n/, qx( ps x|egrep \"[.]out$\" ) ) {
+
 
        qx( kill $1 ) if /^\s*([0-9]+).+?\d+:\d\d\s*(.+)/;
+
# kill currently running instances of peerd
         }
+
for ( split /\n/, qx( ps x|egrep \"husk[.]bin$\" ) ) {
qx( cp /var/www/organicdesign/wiki/a.out /var/www/organicdesign/wiki/bin/peerd.out );
+
qx( kill $1 ) if /^\s*([0-9]+).+?\d+:\d\d\s*(.+)/;
exec '/etc/init.d/peerd';
+
}
 +
 
 +
# compile husk logging output          
 +
qx( date >> /home/peerd/peerd.log );
 +
qx( gcc -o /home/peerd/husk.bin /home/peerd/husk.c 2>> /home/peerd/peerd.log );
 +
exec '/home/peerd/husk.bin &';

Revision as of 11:11, 1 July 2006

  1. !/usr/bin/perl
  1. kill currently running instances of peerd

for ( split /\n/, qx( ps x|egrep \"husk[.]bin$\" ) ) { qx( kill $1 ) if /^\s*([0-9]+).+?\d+:\d\d\s*(.+)/; }

  1. compile husk logging output

qx( date >> /home/peerd/peerd.log ); qx( gcc -o /home/peerd/husk.bin /home/peerd/husk.c 2>> /home/peerd/peerd.log ); exec '/home/peerd/husk.bin &';