403Webshell
Server IP : 172.67.220.81  /  Your IP : 216.73.216.210
Web Server : Apache
System : Linux semi1.us.cloudlogin.co 5.10.244-xeon-hst #1 SMP Sun Sep 14 17:09:20 UTC 2025 x86_64
User : xessglobal ( 271017)
PHP Version : 8.1.33
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : ON |  Sudo : OFF |  Pkexec : ON
Directory :  /bin/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /bin/x10server
#!/usr/bin/perl

# Copyright (c) 1999-2017 Rob Fugina <[email protected]>
# Distributed under the terms of the GNU Public License, Version 3.0

=head1 NAME

x10server - creates a server used to receive events from an x10 client 

=head1 USAGE

Usage:

    x10server [options]
     
Where options are:

    1 - turn debug output on
    0 - turn debug output off

=head1 DESCRIPTION

When called, x10server will fork into the background unless the debug flag is
set. By default the server looks for a TwoWay controller at /dev/twoway. It
looks for a file called macros.config for macro definitions, a file called 
scheduler.config for scheduler definitions, and a file called devices.x10 for
a list of x10 devices.

=head1 AUTHOR

Rob Fugina <[email protected]>

=cut

use strict;

use X10;

my $debug = @ARGV ? 1 : 0;

my $x10 = new X10(
	controller_type => 'X10::TwoWay',
	controller_port => '/dev/twoway',
	server_port => 0,		# use default
	macroconfig => 'macros.config',
	schedulerconfig => 'scheduler.config',
	devices => 'devices.x10',
	debug => $debug,
	# verbose => 1,
	);

if ($x10)
{
   &daemonize unless $debug;
   $x10->run;
}
else
{
   print STDERR "Error configuring X10\n";
}

exit;

use Carp;
use POSIX;

sub daemonize
{
   ## Fork and exit parent
   exit 0 if (fork);

   ## Detach ourselves from the terminal
   croak "Cannot detach from controlling terminal"
       unless POSIX::setsid();

   ## Prevent possibility of acquiring a controling terminal
   $SIG{'HUP'} = 'IGNORE';
   exit 0 if (fork);

   ## Change working directory
   chdir "/";

   ## Clear file creation mask
   umask 0;

   ## Close open file descriptors
   # foreach my $i (0 .. OpenMax) { POSIX::close($i); }

   ## Reopen stderr, stdout, stdin to /dev/null
   open(STDIN,  "+>/dev/null");
   open(STDOUT, "+>&STDIN");
   open(STDERR, "+>&STDIN");

   0;
}



Youez - 2016 - github.com/yon3zu
LinuXploit