You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
1.6 KiB
74 lines
1.6 KiB
#!/bin/bash
|
|
|
|
KAZ_ROOT=$(cd $(dirname $0)/..; pwd)
|
|
. "${KAZ_ROOT}/bin/.commonFunctions.sh"
|
|
setKazVars
|
|
|
|
cd $(dirname $0)
|
|
. "${DOCKERS_ENV}"
|
|
|
|
available_orga=$("${KAZ_BIN_DIR}/kazList.sh" "service" "wp" 2>/dev/null)
|
|
usage () {
|
|
echo "Usage: $0 orga${NL}" \
|
|
" -h : this help${NL}" \
|
|
" -n : simulation${NL}" \
|
|
" [orga] : in${NL}" \
|
|
" ${CYAN}${available_orga}${NC}${NL}"
|
|
exit 1
|
|
}
|
|
|
|
SIMU=
|
|
for ARG in $*; do
|
|
case "$1" in
|
|
-h*) usage ;;
|
|
-n) SIMU=echo; shift ;;
|
|
*) break;;
|
|
esac
|
|
done
|
|
|
|
. ${KAZ_KEY_DIR}/SetAllPass.sh
|
|
|
|
case "$#" in
|
|
0)
|
|
# shared
|
|
ORGA="Kaz"
|
|
wpName="<common WP>"
|
|
|
|
DockerServName="${wordpressServName}"
|
|
WP_URL="${httpProto}://${wordpressHost}.${domain}"
|
|
VOL_PREFIX="${DOCK_VOL}/wordpress_"
|
|
;;
|
|
1)
|
|
# orga
|
|
[[ " ${available_orga} " =~ "$1" ]] || usage
|
|
ORGA=${1%-orga}
|
|
wpName="${ORGA}"
|
|
|
|
DockerServName="${ORGA}-${wordpressServName}"
|
|
WP_URL="${httpProto}://${ORGA}-${wordpressHost}.${domain}"
|
|
VOL_PREFIX="${DOCK_VOL}/orga_${ORGA}-"
|
|
;;
|
|
*)
|
|
usage
|
|
;;
|
|
esac
|
|
|
|
CONF_DIR="${VOL_PREFIX}wordpress/_data"
|
|
|
|
checkDockerRunning "${DockerServName}" "${cloudName}" || exit
|
|
|
|
# XXX trouver un test du genre if ! grep -q "'installed' => true," "${PHP_CONF}" 2> /dev/null; then
|
|
printKazMsg "\n *** Premier lancement de WP"
|
|
|
|
waitUrl "${WP_URL}"
|
|
|
|
${SIMU} curl -X POST \
|
|
-d "user_name=${wp_WORDPRESS_ADMIN_USER}" \
|
|
-d "admin_password=${wp_WORDPRESS_ADMIN_PASSWORD}" \
|
|
-d "admin_password2=${wp_WORDPRESS_ADMIN_PASSWORD}" \
|
|
-d "pw_weak=true" \
|
|
-d "admin_email=admin@kaz.bzh" \
|
|
-d "blog_public=0" \
|
|
-d "language=fr_FR" \
|
|
"${WP_URL}/wp-admin/install.php?step=2"
|
|
echo
|
|
|