started basic documentation, help in main program

This commit is contained in:
levasseur
2021-06-21 18:51:13 +02:00
parent ca4c434073
commit 6f4ec2113b
4 changed files with 84 additions and 0 deletions

16
README.md Normal file
View File

@@ -0,0 +1,16 @@
# init.sh
**init.sh** is an automated configurator for system administrator. It's fully written using Bash scripting and aims to be platform independent. Nevertheless it's requirements turns it naturally to Linux systems. It have long been tested using Debian GNU/Linux, Devuan and different flavor of Ubuntu.
## Getting started
You should consider reading the Beginners guide. If you need to create additional modules to meet your needs, consider reading the Developers guide.
Please also consider that your needs might meet the needs of someone else, thus it would be a good idea to submit your module to init.sh source base.
## Design
**init.sh** relies on three different elements to work:
- the init.sh script, which provide a simple framework and libraries to do simple taks and embed system dependent functions to provide system independent function calls.
- modules that actually do the job on a system independant way through the use of the framework and consisting on very small and simple task.
- multilevel configuration files, being just Bash variables declaration.
Additionally some module might be ran regularly so it could be integrated to a cron-like service.

16
README.md.backup Normal file
View File

@@ -0,0 +1,16 @@
# init.sh
**init.sh** is an automated configurator for system administrator. It's fully written using Bash scripting and aims to be platform independent. Nevertheless it's requirements turns it naturally to Linux systems. It have long been tested using Debian GNU/Linux, Devuan and different flavor of Ubuntu.
## Getting started
You should consider reading the Beginners guide. If you need to create additional modules to meet your needs, consider reading the Developers guide.
Please also consider that your needs might meet the needs of someone else, thus it would be a good idea to submit your module to init.sh source base.
## Design
**init.sh** relies on three different elements to work:
- the init.sh script, which provide a simple framework and libraries to do simple taks and embed system dependent functions to provide system independent function calls.
- modules that actually do the job on a system independant way through the use of the framework and consisting on very small and simple task.
- multilevel configuration files, being just Bash variables declaration.
Additionally some module might be ran regularly so it could be integrated to a cron-like service.

52
init.sh
View File

@@ -65,10 +65,62 @@ else
fi
fi
# Affiche l'aide
disp_help()
{
cat << EOF
Utilisation : init.sh [OPTION] [-m module1,...,moduleN]
Initialise une machine pour l'intégrer à un réseau.
Option :
-m, --module=<liste> Lance les modules indiqués même s'il ne sont pas
dans les fichiers de configuration.
-c, --check-only Lance les procédure de vérification préexecution
sans rien modifier.
-j, --jump Saute les procédures de vérification.
-k, --keep-going L'execution continura en cas d'erreur.
-r, --resume Reprend l'execution la ou elle c'est arrêté.
-h, --help Affiche ce texte d'aide.
Variable d'environnement :
LOGFILE Stocke le nom complet du fichier de log qui sera
utilisé.
Fichiers de configuration :
Le fichier de configuration principal fournira les détails nécessaire
au déploiement de la nouvelle machine. Il doit se situer dans le
répertoire conf/ à coté du script init.sh. Si un fichier appelé
"hostname.sh" (ou hostname est le nom d'hote) existe il sera le fichier
de configuration principal. Dans le cas contraire, le nom générique
"init.conf.sh" sera recherché. En l'absence de fichier de configuration
ce script ne pourra pas fonctionner.
Veuiller consulter les fichiers de configuration fournis en exemple
pour avoir un aperçu des paramêtres disponibles.
EOF
}
# ======================
# ==== Main Program ====
# ======================
# Processing command line options
for opt in $@; do
case $opt in
"-h"|"--help")
disp_help
exit 0
;;
*)
prnt E "Paramètre \'$opt\' non géré."
disp_help
exit 1
;;
esac
done
upgrade_dist
[[ ! $PVEHST ]] && install_ceph && conf_ceph
[[ ! $PVEHST ]] && apt_blacklist

0
nom_module.sh Normal file
View File