[ Avaa Bypassed ]




Upload:

Command:

www-data@3.148.202.164: ~ $
#!/usr/bin/perl
# Add needed firewall rules and syslog entry, and apply configurations

require './bandwidth-lib.pl';
&ReadParse();
$access{'setup'} || &error($text{'setup_ecannot'});

# Work out interface
$iface = $in{'iface'} || $in{'other'};
$iface =~ /^\S+$/ || &error($text{'setup_eiface'});

# Add missing firewall rules
$err = &setup_rules($iface);
&error($err) if ($err);

if ($syslog_module eq "syslog") {
	# Add syslog entry
	$conf = &syslog::get_config();
	$sysconf = &find_sysconf($conf);
	if (!$sysconf) {
		&lock_file($syslog::config{'syslog_conf'});
		if ($syslog::config{'tags'}) {
			local $conf = &syslog::get_config();
			($tag) = grep { $_->{'tag'} eq '*' } @$conf;
			}
		&syslog::create_log({ 'file' => $bandwidth_log,
				      'active' => 1,
				      'section' => $tag,
				      'sel' => [ &get_loglevel() ] });
		&unlock_file($syslog::config{'syslog_conf'});
		$err = &syslog::restart_syslog();
		&error($err) if ($err);
		}
	}
else {
	# Add syslog-ng entry
	$conf = &syslog_ng::get_config();
	($dest, $filter, $log) = &find_sysconf_ng($conf);
	&lock_file($syslog_ng::config{'syslogng_conf'});
	if (!$dest) {
		# Create destination file entry
		$dest = { 'name' => 'destination',
			  'type' => 1,
			  'values' => [ 'd_bandwidth' ],
			  'members' => [
				{ 'name' => 'file',
				  'values' => [ $bandwidth_log ] }
					]
			};
		&syslog_ng::save_directive($conf, undef, undef, $dest, 0);
		}
	if (!$filter) {
		# Create filter for facility and level
		local @ll = &get_loglevel();
		($fac, $lvl) = split(/\./, $ll[0]);
		$lvl =~ s/^=//;
		$filter = { 'name' => 'filter',
			    'type' => 1,
			    'values' => [ 'f_bandwidth' ],
			    'members' => [ ]
			  };
		if ($fac ne "*") {
			push(@{$filter->{'members'}},
			     { 'name' => 'facility',
			       'values' => [ $fac ] });
			}
		if ($fac ne "*" && $lvl ne "*") {
			push(@{$filter->{'members'}}, "and");
			}
		if ($lvl ne "*") {
			push(@{$filter->{'members'}},
			     { 'name' => 'priority',
			       'values' => [ $lvl ] });
			}
		&syslog_ng::save_directive($conf, undef, undef, $filter, 0);
		}
	if (!$log) {
		# Create log for the default source, destination and filter
		@sources = &syslog_ng::find("source", $conf);
		$log = { 'name' => 'log',
			 'type' => 1,
			 'values' => [ ],
			 'members' => [
				{ 'name' => 'source',
				  'values' => [ $sources[0]->{'value'} ], },
				{ 'name' => 'filter',
				  'values' => [ "f_bandwidth" ], },
				{ 'name' => 'destination',
				  'values' => [ "d_bandwidth" ], },
					]
			};
		&syslog_ng::save_directive($conf, undef, undef, $log, 0);
		}
	&unlock_file($syslog_ng::config{'syslogng_conf'});
	}

# Save the interface
&lock_file($module_config_file);
$config{'iface'} = $iface;
&save_module_config();
&unlock_file($module_config_file);

# Setup the rotation cron job
$job = &find_cron_job();
if (!$job) {
	&cron::create_wrapper($cron_cmd, $module_name, "rotate.pl");
	$job = { 'user' => 'root',
		 'active' => 1,
		 'command' => $cron_cmd,
		 'mins' => '0',
		 'hours' => '*',
		 'days' => '*',
		 'months' => '*',
		 'weekdays' => '*',
		};
	&lock_file(&cron::cron_file($job));
	&cron::create_cron_job($job);
	&unlock_file(&cron::cron_file($job));
	}

&webmin_log("setup", undef, $iface);
&redirect("");


Filemanager

Name Type Size Permission Actions
help Folder 0755
images Folder 0755
lang Folder 0755
CHANGELOG File 1.14 KB 0644
acl_security.pl File 399 B 0755
backup_config.pl File 1.21 KB 0755
bandwidth-lib.pl File 21.19 KB 0755
config File 50 B 0644
config-mandrake-linux File 30 B 0644
config.info File 260 B 0644
config.info.ca File 296 B 0644
config.info.de File 285 B 0644
config.info.es File 292 B 0644
config.info.fr File 267 B 0644
config.info.hr File 0 B 0644
config.info.hu File 279 B 0644
config.info.ms File 259 B 0644
config.info.nl File 270 B 0644
config.info.no File 266 B 0644
config.info.pl File 272 B 0644
config.info.sv File 0 B 0644
defaultacl File 8 B 0644
index.cgi File 11.93 KB 0755
log_parser.pl File 372 B 0755
module.info File 189 B 0644
module.info.af File 0 B 0644
module.info.af.auto File 143 B 0644
module.info.ar File 0 B 0644
module.info.ar.auto File 230 B 0644
module.info.be File 0 B 0644
module.info.be.auto File 265 B 0644
module.info.bg File 0 B 0644
module.info.bg.auto File 247 B 0644
module.info.ca File 161 B 0644
module.info.cs File 29 B 0644
module.info.cs.auto File 115 B 0644
module.info.da File 0 B 0644
module.info.da.auto File 136 B 0644
module.info.de File 140 B 0644
module.info.el File 0 B 0644
module.info.el.auto File 294 B 0644
module.info.es File 42 B 0644
module.info.es.auto File 114 B 0644
module.info.eu File 0 B 0644
module.info.eu.auto File 192 B 0644
module.info.fa File 0 B 0644
module.info.fa.auto File 244 B 0644
module.info.fi File 0 B 0644
module.info.fi.auto File 174 B 0644
module.info.fr File 39 B 0644
module.info.fr.auto File 132 B 0644
module.info.he File 0 B 0644
module.info.he.auto File 181 B 0644
module.info.hr File 0 B 0644
module.info.hr.auto File 158 B 0644
module.info.hu File 29 B 0644
module.info.hu.auto File 149 B 0644
module.info.it File 0 B 0644
module.info.it.auto File 172 B 0644
module.info.ja File 0 B 0644
module.info.ja.auto File 189 B 0644
module.info.ko File 0 B 0644
module.info.ko.auto File 165 B 0644
module.info.lt File 0 B 0644
module.info.lt.auto File 168 B 0644
module.info.lv File 0 B 0644
module.info.lv.auto File 167 B 0644
module.info.ms File 143 B 0644
module.info.mt File 0 B 0644
module.info.mt.auto File 149 B 0644
module.info.nl File 28 B 0644
module.info.nl.auto File 109 B 0644
module.info.no File 35 B 0644
module.info.no.auto File 100 B 0644
module.info.pl File 132 B 0644
module.info.pt File 0 B 0644
module.info.pt.auto File 164 B 0644
module.info.pt_BR File 0 B 0644
module.info.pt_BR.auto File 170 B 0644
module.info.ro File 0 B 0644
module.info.ro.auto File 176 B 0644
module.info.ru File 61 B 0644
module.info.ru.auto File 216 B 0644
module.info.sk File 0 B 0644
module.info.sk.auto File 152 B 0644
module.info.sl File 0 B 0644
module.info.sl.auto File 158 B 0644
module.info.sv File 0 B 0644
module.info.sv.auto File 138 B 0644
module.info.th File 0 B 0644
module.info.th.auto File 262 B 0644
module.info.tr File 0 B 0644
module.info.tr.auto File 197 B 0644
module.info.uk File 0 B 0644
module.info.uk.auto File 273 B 0644
module.info.ur File 0 B 0644
module.info.ur.auto File 231 B 0644
module.info.vi File 0 B 0644
module.info.vi.auto File 174 B 0644
module.info.zh File 0 B 0644
module.info.zh.auto File 126 B 0644
module.info.zh_TW File 0 B 0644
module.info.zh_TW.auto File 132 B 0644
rotate.cgi File 391 B 0755
rotate.pl File 1.3 KB 0755
setup.cgi File 3.18 KB 0755
turnoff.cgi File 1.22 KB 0755
uninstall.pl File 264 B 0755