1 --- local/fixproc.orig 2005-05-18 09:57:16.000000000 -0400
2 +++ local/fixproc 2005-05-18 11:00:38.000000000 -0400
10 $database_file = '/local/etc/fixproc.conf';
12 $debug = 0; # specify debug level using -dN
14 printf (stderr "create_sh_script\n") if ($debug > 0);
17 - open (file, ">"."$file") || die "$0: cannot open $file\n";
18 while ( $shell_lines[$i] ne $shell_end_marker )
20 printf (file "%s", $shell_lines[$i]);
23 # it must be "shell", so execute the shell script defined in database
25 - local ($tmpfile) = "/tmp/fix_$$";
26 + local ($tmpfile) = new File::Temp(TEMPLATE => 'fix_XXXXX',
29 &create_sh_script ($fix{$proc}, $tmpfile);
31 # return code is number divided by 256
32 $error_code = (system "$tmpfile") / 256;
33 - system "rm $tmpfile";
34 return ($fix_failed_error) if ($error_code != 0);
36 return &do_exist ($proc);
38 # if not "exist", then it must be "shell", so execute the shell script
41 - local ($tmpfile) = "/tmp/check_$$";
42 + local ($tmpfile) = new File::Temp(TEMPLATE => 'check_XXXXXX',
45 &create_sh_script ($check{$proc}, $tmpfile);
47 # return code is number divided by 256
48 $error_code = (system "$tmpfile") / 256;
49 - system "rm $tmpfile";
50 return ($check_failed_error) if ($error_code != 0);
52 # check passed, continue