projects
/
tpope-extra.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a22a62d
)
If I have to commit one more time, I will have no choice but to sully my good logs...
author
Tim Pope
<code@tpope.net>
Wed, 1 Jun 2005 05:14:59 +0000
(
05:14
+0000)
committer
Tim Pope
<code@tpope.net>
Wed, 1 Jun 2005 05:14:59 +0000
(
05:14
+0000)
perl/mobile-phone-monitor
patch
|
blob
|
history
diff --git
a/perl/mobile-phone-monitor
b/perl/mobile-phone-monitor
index dbc549f08d54b6a06f8823e070ea76f9ea4c1811..5a46f1e2a954b2cad27540933daae393da8c9011 100755
(executable)
--- a/
perl/mobile-phone-monitor
+++ b/
perl/mobile-phone-monitor
@@
-123,6
+123,21
@@
sub output_status {
rename "/tmp/.phone-status.new", "/tmp/.phone-status" || die $!;
}
+sub daemonize {
+ chdir "/";
+ my $pid=fork();
+ if($pid) {
+ exit(0)
+ }
+ elsif(defined($pid))
+ {
+ close STDIN;
+ close STDOUT;
+ close STDERR;
+ }
+ else { exit(1); }
+}
+
sub death {
$gsm->disconnect() if($gsm);
unlink "/tmp/.phone-status.new", "/tmp/.phone-status";