aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2014-09-13 19:23:44 +0200
committerAngelo Naselli <anaselli@linux.it>2014-09-13 19:23:44 +0200
commita947fa7777200f258598c237afa764293de7ae71 (patch)
tree512d35b8b1e70e8eb033a2b34427d6afd80890ef /scripts
parentb1d81dde492a803b6f2b9760c9ab1527f7e73659 (diff)
downloadmanatools-a947fa7777200f258598c237afa764293de7ae71.tar
manatools-a947fa7777200f258598c237afa764293de7ae71.tar.gz
manatools-a947fa7777200f258598c237afa764293de7ae71.tar.bz2
manatools-a947fa7777200f258598c237afa764293de7ae71.tar.xz
manatools-a947fa7777200f258598c237afa764293de7ae71.zip
Poddified and added description
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/mana75
1 files changed, 64 insertions, 11 deletions
diff --git a/scripts/mana b/scripts/mana
index ee3da644..2910025b 100755
--- a/scripts/mana
+++ b/scripts/mana
@@ -1,19 +1,59 @@
#!/usr/bin/perl
+# vim: set et ts=4 sw=4:
+#*****************************************************************************
+#
+# Copyright (c) 2014 Angelo naselli <anaselli@linux.it>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2, as
+# published by the Free Software Foundation.
+#
+# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+#*****************************************************************************
use AdminPanel::Privileges;
use yui;
# TODO from configuration file?
+# TODO localization for descriptions
my %modules = (
- log => '/usr/bin/manalog',
- user => '/usr/bin/manauser',
- service => '/usr/bin/manaservice',
- clock => '/usr/bin/manaclock',
- host => '/usr/bin/manahost',
- pan => '/usr/bin/mpan.pl',
- proxy => '/usr/bin/manaproxy',
-
+ log => {
+ exec => '/usr/bin/manalog',
+ descr => "manalog: journalct log reader",
+ },
+ user => {
+ exec => '/usr/bin/manauser',
+ descr => "manauser: user manager",
+ },
+ service => {
+ exec => '/usr/bin/manaservice',
+ descr => "manaservice: service manager",
+ },
+ clock => {
+ exec => '/usr/bin/manaclock',
+ descr => "manaclock: date/time manager",
+ },
+ host => {
+ exec => '/usr/bin/manahost',
+ descr => "manahost: hosts manager",
+ },
+ pan => {
+ esxec => '/usr/bin/mpan.pl',
+ descr => "mpan: admin panel",
+ },
+ proxy => {
+ exec => '/usr/bin/manaproxy',
+ descr => "manaproxy: proxy manager",
+ },
);
my $cmdline = new yui::YCommandLine;
@@ -25,7 +65,7 @@ my $cmd = $ARGV[0];
die "Command ". $cmd . " not found!\n" if !defined($modules{$cmd});
-my $mod = $modules{$cmd};
+my $mod = $modules{$cmd}->{exec};
shift(@ARGV);
if(is_root_capability_required()) {
@@ -34,14 +74,27 @@ if(is_root_capability_required()) {
system($mod, @ARGV);
}
+#=============================================================
+
+=head2 usage
+
+
+=head3 DESCRIPTION
+
+usage print the mana usage help
+
+=cut
+
+#=============================================================
+
sub usage {
print "\n";
print "Usage mana --help | -h print this help\n";
print "Usage mana <command> [args...]\n\n";
- print "valid <commands>:\n\t";
+ print "valid <commands>:\n";
# TODO better presentation
while ( my ($key, $value) = each(%modules) ) {
- print " " . $key;
+ print "<" . $key . ">\t\t". $value->{descr} . "\n";
}
print "\n";
exit(0);