<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl

use File::Path;
use POSIX ":sys_wait_h";

$timeout = 60;

%{ENV}-&gt;{"MOZILLA_FIVE_HOME"}="/usr/lib/mozilla";

umask 022;

if ( -f "/usr/lib/mozilla/regxpcom" )
{
    # remove all of the old files
    rmtree("/usr/lib/mozilla/chrome/overlayinfo");
    unlink &lt;/usr/lib/mozilla/chrome/*.rdf&gt;;
    unlink("/usr/lib/mozilla/component.reg");

    # crate a new clean path
    mkpath("/usr/lib/mozilla/chrome/overlayinfo");

    # run regxpcom
    $pid = fork();

    # I am the child.
    if ($pid == 0) {
	exec("/usr/lib/mozilla/regxpcom &gt; /dev/null 2&gt; /dev/null");
    }
    # I am the parent.
    else {
	my $timepassed = 0;
	do {
	    $kid = waitpid($pid, &amp;WNOHANG);
	    sleep(1);
	    $timepassed++;
        } until $kid == -1 || $timepassed &gt; $timeout;

	# should we kill?
	if ($timepassed &gt; $timeout) {
	    kill (9, $pid);
	}
    }

    # and run regchrome for good measure
    $pid = fork();

    # I am the child.
    if ($pid == 0) {
	exec("/usr/lib/mozilla/regchrome &gt; /dev/null 2&gt; /dev/null");
    }
    # I am the parent.
    else {
	my $timepassed = 0;
	do {
	    $kid = waitpid($pid, &amp;WNOHANG);
	    sleep(1);
	    $timepassed++;
        } until $kid == -1 || $timepassed &gt; $timeout;

	# should we kill?
	if ($timepassed &gt; $timeout) {
	    kill (9, $pid);
	}
    }

}

</pre></body></html>