initial commit of file from CVS for smeserver-shellinabox on Sat Sep 7 16:41:40 AEST 2024
This commit is contained in:
33
root/etc/e-smith/web/functions/shellinabox
Normal file
33
root/etc/e-smith/web/functions/shellinabox
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/perl
|
||||
#----------------------------------------------------------------------
|
||||
# heading : Administration
|
||||
# description : ShellInaBox
|
||||
# navigation : 4000 4200
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use CGI':all';
|
||||
use CGI::Carp qw(fatalsToBrowser);
|
||||
use esmith::ConfigDB;
|
||||
|
||||
BEGIN
|
||||
{
|
||||
$ENV {'PATH'} = '/bin:/usr/bin:/sbin';
|
||||
$ENV {'SHELL'} = '/bin/bash';
|
||||
delete $ENV {'ENV'};
|
||||
}
|
||||
|
||||
my $DB = esmith::ConfigDB->open() ||
|
||||
die esmith::ConfigDB->error;
|
||||
my $url_Name = $DB->get_prop( 'shellinaboxd', 'Name' ) || '';
|
||||
|
||||
my $q = new CGI;
|
||||
my $content="0; url=https://".$ENV {'HTTP_X_FORWARDED_HOST'}."/"."$url_Name";
|
||||
$q->default_dtd('-//W3C//DTD XHTML 1.0 Transitional//EN');
|
||||
|
||||
print $q->header ('text/html');
|
||||
print $q->start_html (-head=>meta({-http_equiv=>'refresh', -content=>$content}));
|
||||
|
||||
|
||||
|
||||
print $q->end_html;
|
Reference in New Issue
Block a user