aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatteo Pasotti <matteo.pasotti@gmail.com>2014-09-14 23:47:30 +0200
committerMatteo Pasotti <matteo.pasotti@gmail.com>2014-09-14 23:47:30 +0200
commit66c0d6fa5e9555b08e40961585e15f59e2403903 (patch)
treeeb7b447a4bf823fffe9167368818f295f1e84d0f
parent886f0e426c410b28bd36ccc9d65f8ed39ab37d2a (diff)
parenta947fa7777200f258598c237afa764293de7ae71 (diff)
downloadcolin-keep-66c0d6fa5e9555b08e40961585e15f59e2403903.tar
colin-keep-66c0d6fa5e9555b08e40961585e15f59e2403903.tar.gz
colin-keep-66c0d6fa5e9555b08e40961585e15f59e2403903.tar.bz2
colin-keep-66c0d6fa5e9555b08e40961585e15f59e2403903.tar.xz
colin-keep-66c0d6fa5e9555b08e40961585e15f59e2403903.zip
Merge branch 'master' of ssh://git.mageia.org/software/adminpanel
-rw-r--r--Changes2
-rwxr-xr-xscripts/mana75
2 files changed, 65 insertions, 12 deletions
diff --git a/Changes b/Changes
index dbf3707..c30485f 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,5 @@
Revision history for AdminPanel-Shared
-1.0.0-3
+1.0.0-3 13/09/2014 18:80
- added mana script to run pkexec into script for any tools
and as a single entry for desktop file
- dragora-urpm-sources.pl crashed updating media, if no media
diff --git a/scripts/mana b/scripts/mana
index ee3da64..2910025 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);