-
Notifications
You must be signed in to change notification settings - Fork 0
/
run
50 lines (38 loc) · 1.5 KB
/
run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# Ref: https://github.com/femiwiki/docker-mediawiki/blob/master/run
set -euo pipefail; IFS=$'\n\t'
: ${MEDIAWIKI_HAS_ALREADY_DATABASE:=false}
echo 'Starting Wiki ...'
cd /usr/src
# LocalSettings is needed for wiki database already set, but ignore this line if locally run
if [ $MEDIAWIKI_HAS_ALREADY_DATABASE = true ]; then
echo 'Wiki has already Database ...'
ln -sf /ct/LocalSettings.php /usr/src/LocalSettings.php
fi
# If there is no LocalSettings.php, create one using maintenance/install.php
if [ ! -f /usr/src/LocalSettings.php ]; then
DB_PREFIX="$(php -r 'require "/ct/secret.php"; echo $wgDBprefix;')"
DB_NAME="$(php -r 'require "/ct/secret.php"; echo $wgDBname;')"
DB_HOSTNAME="$(php -r 'require "/ct/secret.php"; echo $wgDBserver;')"
DB_USERNAME="$(php -r 'require "/ct/secret.php"; echo $wgDBuser;')"
DB_PASSWORD="$(php -r 'require "/ct/secret.php"; echo $wgDBpassword;')"
php /usr/src/maintenance/install.php \
--lang ko \
--scriptpath '' \
--dbtype mysql \
--dbname ${DB_NAME} \
--dbserver "${DB_HOSTNAME}" \
--dbuser "${DB_USERNAME}" \
--dbpass "${DB_PASSWORD}" \
--dbprefix "${DB_PREFIX}" \
--installdbuser "${DB_USERNAME}" \
--installdbpass "${DB_PASSWORD}" \
--pass 'admin_password_please_change' \
'한양위키' Admin
# Overwrite LocalSettings.php generated by install script
ln -sf /ct/LocalSettings.php /usr/src/LocalSettings.php
fi
# Run update script
php /usr/src/maintenance/update.php --quick
# run PHP FPM
php-fpm