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 \"[.] | + | |
− | + | # kill currently running instances of peerd | |
− | + | for ( split /\n/, qx( ps x|egrep \"husk[.]bin$\" ) ) { | |
− | qx( | + | qx( kill $1 ) if /^\s*([0-9]+).+?\d+:\d\d\s*(.+)/; |
− | exec '/ | + | } |
+ | |||
+ | # 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
- !/usr/bin/perl
- 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*(.+)/; }
- 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 &';