Commentaires
This commit is contained in:
parent
96ae44be39
commit
13cfae2f31
|
@ -7,17 +7,21 @@ then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Récupération de la configuration
|
||||||
test -f /etc/suidchecker.conf && . /etc/suidchecker.conf || . suidchecker.conf
|
test -f /etc/suidchecker.conf && . /etc/suidchecker.conf || . suidchecker.conf
|
||||||
|
|
||||||
export DATABASE
|
export DATABASE
|
||||||
export INSTALL_PATH
|
export INSTALL_PATH
|
||||||
|
|
||||||
|
# Récupération des paramètres
|
||||||
OPTS=$(getopt -o h -l init,reinit,add,check,help -- "$@")
|
OPTS=$(getopt -o h -l init,reinit,add,check,help -- "$@")
|
||||||
eval set -- $OPTS
|
eval set -- $OPTS
|
||||||
|
|
||||||
|
# On conserve le code de sortie des sous-scripts
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
|
# Définition du message d'aide
|
||||||
echo "Utilisation du script :"
|
echo "Utilisation du script :"
|
||||||
echo -e "\t--init : initialise la base de données"
|
echo -e "\t--init : initialise la base de données"
|
||||||
echo -e "\t--reinit : réinitialise la base de données"
|
echo -e "\t--reinit : réinitialise la base de données"
|
||||||
|
@ -26,23 +30,28 @@ usage() {
|
||||||
echo -e "\t--help, -h : affiche ce message"
|
echo -e "\t--help, -h : affiche ce message"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Initialisation
|
||||||
init() {
|
init() {
|
||||||
$INSTALL_PATH/init.sh
|
$INSTALL_PATH/init.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Réinitialisation
|
||||||
reinit() {
|
reinit() {
|
||||||
rm $DATABASE
|
rm $DATABASE
|
||||||
init
|
init
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Recherche et ajout de nouveaux fichiers
|
||||||
add() {
|
add() {
|
||||||
$INSTALL_PATH/add.sh
|
$INSTALL_PATH/add.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Vérification des fichiers indexés
|
||||||
check() {
|
check() {
|
||||||
$INSTALL_PATH/check.sh
|
$INSTALL_PATH/check.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Pris en compte des paramètres
|
||||||
while true ; do
|
while true ; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-h|--help) usage; exit 0;;
|
-h|--help) usage; exit 0;;
|
||||||
|
|
Loading…
Reference in New Issue