Opmenu is a script for basic Linux system administration.
Python Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
po
README
apache.generic.mnu
i18n.py
main.mnu
mysql.generic.mnu
opmenu.py
services.main.mnu
setup_lang.sh
system.generic.mnu
system.main.mnu

README

OpMenu is a python based script for basic Linux system administration.

It follows the Gomenu script guidelines (https://fossies.org/linux/privat/old/OpMenu3.0.tar.gz/index_af.html). 
OpMenu uses .mnu files to build a screen menu that allow to low levels sysadmins and system operators do basic 
and preconfigured actions (f.e. restart a webserver, check the status of a daemon, etc...)

You can find some basic .mnu examples files in the repository. 
All menu options have to begin with $MENU key and all the actions have to contain .sh or sudo command. 
A lot of Gomenu .mnu must be compatibles.

=====================

Requirements:

* Python 2.X
* main.mnu file
* python-distutils-extra for Internationalize Language

=====================

TODO

* Error control
* Improve Look&Feel

=====================

LANGUAGE SETUP

Execute script setup_lang.sh to compile languages in your system.

------------------------------
#!/bin/bash

msgfmt po/es_ES.po --output-file /usr/share/locale/es/LC_MESSAGES/opmenu.mo # spanish translation
msgfmt po/gl_ES.po --output-file /usr/share/locale/gl/LC_MESSAGES/opmenu.mo # galician translation
msgfmt po/ca_ES.po --output-file /usr/share/locale/ca/LC_MESSAGES/opmenu.mo # catalan translation

exit
------------------------------

If you want to add a new translation or add/modify texts,  you will have to regenerate the opmenu.pot with the command:

# xgettext --language=Python --keyword=_ --output=po/opmenu.pot --from-code=UTF-8 `find . -name "*.py"`

(Also you can easily add languages with Poedit utility: http://www.poedit.net/)

Save the generated files in the "po" directory and run the following command for the new language.

# msgfmt po/ca_ES.po --output-file /usr/share/locale/ca/LC_MESSAGES/opmenu.mo

You can test language seting LANG environment.

Ex.

# export LANG=gl_ES.UTF-8

??NOTE: To add new texts that you want translate, add it to script with _ ("sample text") syntax.??

=====================

INSTALL NOTES.

Add oper group to sudoers for nonpassword required if user operator is not root.

%oper ALL=(ALL:ALL) NOPASSWD:ALL

For automatic start of the program you have to add the next lines in the .bash_profile of the user:

exec  ./opmenu.py

=====================

Comments and request are welcome.

Regards!

D. Acacio