-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure
executable file
·41 lines (36 loc) · 1.08 KB
/
configure
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
#! /bin/bash
# Base URL of the MediaWiki installation
BASE_MW_URL=http://localhost/wiki/
read -p "Base URL of the MediaWiki installation ($BASE_MW_URL): " ANSWER_1;
if [ ${ANSWER_1} ];
then BASE_MW_URL=$ANSWER_1;
fi
echo "";
# Username of the MediaWiki API bot user
API_USERNAME=Sysop
read -p "Username of the MediaWiki API user ($API_USERNAME): " ANSWER_2;
if [ ${ANSWER_2} ];
then API_USERNAME=$ANSWER_1;
fi
echo "";
# Password of the MediaWiki API bot user
API_PASS=secret123
read -s -p "Password of the MediaWiki API bot user ($API_PASS): " ANSWER_3;
if [ ${ANSWER_3} ];
then API_PASS=$ANSWER_1;
fi
echo "";
# Template path, relative to the SemanticDAO package.
TPL_DIR=/src/smw/templates
read -p "Template path ($TPL_DIR): " ANSWER_4;
if [ ${ANSWER_4} ];
then TPL_DIR=$ANSWER_1;
fi
echo "";
## Create config.ini file
cp src/config.tpl config.ini;
sed -i "s|@@BASE_MW_URL@@|$BASE_MW_URL|g" config.ini
sed -i "s|@@API_USERNAME@@|$API_USERNAME|g" config.ini
sed -i "s|@@API_PASS@@|$API_PASS|g" config.ini
sed -i "s|@@TPL_DIR@@|$TPL_DIR|g" config.ini
echo "Saved configuration file to config.ini"