Skip to content
Snippets Groups Projects
Forked from smradius / smradius
504 commits behind the upstream repository.
smadmin 6.01 KiB
#!/usr/bin/perl
# SMRadius administration tool
# Copyright (C) 2009, AllWorldIT
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.


use strict;
use warnings;


# Set library directory
use lib qw(
	../ ./
	smradius/modules/authentication
	smradius/modules/userdb
	smradius/modules/accounting
	smradius/modules/features
	smradius/modules/config
	awitpt/db
);


use Config::IniFiles;
use Getopt::Long;

use smradius::logging;
use smradius::version;


print("SMRadius Admin Tool v".VERSION." - Copyright (c) 2008-2009 AllWorldIT\n");

# Fire up commandline processing...
my %opts;
GetOptions(
	\%opts,
	"help",
	"config:s",
	"cleanup",
	"debug",
);

# Check for some args
if ($opts{'help'}) {
	displayHelp();
	exit 0;
}

# Set defaults
my $cfg;
$cfg->{'config_file'} = "smradiusd.conf.testing";

# Check if we must override
if (defined($opts{'config'}) && $opts{'config'} ne "") {
	$cfg->{'config_file'} = $opts{'config'};
}

# Check config file exists