diff --git a/lib/filefct.sh b/lib/filefct.sh index 848f54f..de3331e 100644 --- a/lib/filefct.sh +++ b/lib/filefct.sh @@ -157,6 +157,10 @@ isdirempty() { dir=$1 + if [[ -f $dir ]]; then + prnt E "isdirempty():The given parameter is not a directory." + die 15 + fi if [[ ! -d $dir ]]; then return 0 fi diff --git a/lib/support.sh b/lib/support.sh index 1453596..429477a 100644 --- a/lib/support.sh +++ b/lib/support.sh @@ -35,10 +35,13 @@ Options : -R, --no-root-check Ne pas vérifier les droits root (ou UID 0) -P, --no-proxy Ne pas utiliser de proxy lors de l'utilisation de ce script (n'empêche pas leur configuration via modules) + -D, --no-deps Ne pas vérifier les dépendances entre les modules. -h, --help Affiche ce texte d'aide. -s, --shell Lance un shell avec tout l'environnement du script pour débogage. Aucune action ou vérification n'est faite en dehors des commandes lancées dans le shell. + --chroot Permet à init de ne pas appliquer les modifications au + système de fichier racine mais à un système différent. -l, --logfile Nom du fichier de log. Peut aussi être changé via la variable d'environnement LOGFILE. -v, --version Affiche la version de ce script et celles de diff --git a/lib/zzz_main_fct.sh b/lib/zzz_main_fct.sh index 11200e4..6b60e29 100644 --- a/lib/zzz_main_fct.sh +++ b/lib/zzz_main_fct.sh @@ -24,6 +24,7 @@ read_commandline() local want_module=false local want_logfile=false local want_conffile=false + local want_conffile=false local opt= for opt in $@; do @@ -75,10 +76,14 @@ read_commandline() "-s"|"--shell") export RUN_SHELL=true ;; + "--chroot") + local want_chroot + ;; *) if [[ $want_module == true ]]; then [[ $want_logfile == true ]] && synthax_error [[ $want_conffile == true ]] && synthax_error + [[ $want_chroot == true ]] && synthax_error if [[ -z $MANUAL_MODULE_LIST ]]; then export MANUAL_MODULE_LIST=$opt want_module=false @@ -90,6 +95,7 @@ read_commandline() elif [[ $want_logfile == true ]]; then [[ $want_module == true ]] && synthax_error [[ $want_conffile == true ]] && synthax_error + [[ $want_chroot == true ]] && synthax_error if [[ -z $NEW_LOGFILE ]]; then export NEW_LOGFILE=$opt want_logfile=false @@ -100,8 +106,14 @@ read_commandline() elif [[ $want_conffile == true ]]; then [[ $want_module == true ]] && synthax_error [[ $want_logfile == true ]] && synthax_error + [[ $want_chroot == true ]] && synthax_error export CONFFILES="$CONFFILES $opt" want_logfile=false + elif [[ $want_chroot == true ]]; then + [[ $want_module == true ]] && synthax_error + [[ $want_logfile == true ]] && synthax_error + [[ $want_conffile == true ]] && synthax_error + # To be finished else prnt E "Paramètre \"$opt\" non géré." die 1 --force