+sub find_init (@) {
+ my ($cmd, $dir) = @_;
+
+ # Open given init directory.
+ opendir (INITDIR, "$dir") || die "Cannot opendir $dir: $!";
+
+ # Read-in init files from directory.
+ my @inits = readdir(INITDIR);
+
+ # Close directory handle.
+ closedir(INITDIR);
+
+ # Loop through the directory.
+ foreach my $init (@inits) {
+ # Check if the current processed file belongs to the given command.
+ if ($init =~ /S\d+\d+$cmd\z/) {
+ # Found, return "1" - True.
+ return "1";
+ }
+ }
+
+ # Nothing found, return nothing.
+ return;
+}
+
+sub isrunning (@) {
+ my ($cmd, $col) = @_;
+ my $status = "<td align='center' bgcolor='${Header::colourred}'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td><td colspan='2' $col></td>";