From 0eb98c72012721eefe1c90875538d914ea70b741 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 1 Jun 2005 05:14:59 +0000 Subject: [PATCH] If I have to commit one more time, I will have no choice but to sully my good logs with profanity --- perl/mobile-phone-monitor | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/perl/mobile-phone-monitor b/perl/mobile-phone-monitor index dbc549f..5a46f1e 100755 --- 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"; -- 2.30.2