ninedocker/services/30-openldap/misc/nine.sh

38 lines
1013 B
Bash
Raw Normal View History

2024-07-24 16:11:40 +02:00
#!/bin/bash
function upopenldap {
if [[ $OPENLDAP_ACTIVATE == 1 && $OPENLDAP_LOCAL == 1 ]]
then
Title ${OPENLDAP_SERVICE_NAME^^}
EchoVert "CONTAINER"
mkdir -p ./services/30-openldap/volume/data
chmod a+wr ./services/30-openldap/volume/data
upservice $OPENLDAP_SERVICE_NAME wait
docker-compose exec $OPENLDAP_SERVICE_NAME /nine/init.sh
Echo
fi
}
function destroyopenldap {
if [[ $OPENLDAP_LOCAL == 1 ]]
then
Title "DESTROY $OPENLDAP_SERVICE_NAME"
stop $OPENLDAP_SERVICE_NAME 1
docker-compose rm -s -v -f "$OPENLDAP_SERVICE_NAME"
2024-07-26 22:34:20 +02:00
if [[ -z $1 ]]; then
Question_ouinon "Souhaitez-vous supprimer l'annuaire associé à $OPENLDAP_SERVICE_NAME ?";
response=$?
fi
if [[ "$response" == 0 || ! -z $1 ]]
2024-07-24 16:11:40 +02:00
then
2024-07-26 22:34:20 +02:00
EchoRouge "Suppression de l'annuaire"
rm -rf ./services/30-openldap/volume/data
2024-07-24 16:11:40 +02:00
fi
echo ""
fi
}