From f2472322d18f83dba912aed9f583c6b3eb6aa112 Mon Sep 17 00:00:00 2001 From: Elijah Perrault Date: Thu, 20 Jan 2011 00:21:55 -0700 Subject: [PATCH 1/2] Use exit, not die. --- bin/auto | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bin/auto b/bin/auto index 2a4b60a..070c99f 100755 --- a/bin/auto +++ b/bin/auto @@ -174,7 +174,7 @@ foreach my $cskey (keys %cservers) { my $data = readline($SOCKET{$cskey}); # Lost connection: kill process. unless (defined $data) { - die; + exit; } # Get rid of the newlines. chomp $data; @@ -201,6 +201,7 @@ else { } undef $it; +println "mk" and mod_load("m_hw"); # Keep Auto alive. while (1) { sleep 1; } @@ -223,3 +224,15 @@ sub socksnd return 0; } } + +# Load a module. +sub mod_load { + my ($module) = @_; + + if (-e "$Bin/../modules/".lc($module).".pm") { + do "$Bin/../modules/".lc($module).".pm" and return 1 or print $@ and return 0; + } + else { + return 0; + } +} From 1ce1b537ffef33dfd64ea8ea0c6298857b9f07a2 Mon Sep 17 00:00:00 2001 From: Elijah Perrault Date: Wed, 19 Jan 2011 23:23:05 -0800 Subject: [PATCH 2/2] This was for testing purposes. --- bin/auto | 2 -- 1 file changed, 2 deletions(-) mode change 100755 => 100644 bin/auto diff --git a/bin/auto b/bin/auto old mode 100755 new mode 100644 index 070c99f..d670ce5 --- a/bin/auto +++ b/bin/auto @@ -201,8 +201,6 @@ else { } undef $it; -println "mk" and mod_load("m_hw"); - # Keep Auto alive. while (1) { sleep 1; }