forked from msimerson/Mail-Toaster-6
-
Notifications
You must be signed in to change notification settings - Fork 0
/
provision-sphinxsearch.sh
executable file
·51 lines (40 loc) · 1.11 KB
/
provision-sphinxsearch.sh
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
51
#!/bin/sh
# shellcheck disable=1091
. mail-toaster.sh || exit
export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
install_sphinxsearch()
{
tell_status "installing Sphinxsearch"
stage_pkg_install sphinxsearch || exit
stage_make_conf textproc_sphinxsearch 'textproc_sphinxsearch_SET=ID64'
stage_pkg_install dialog4ports || exit
tell_status "Compiling Sphinx search"
export BATCH=${BATCH:="1"}
stage_port_install textproc/sphinxsearch || exit
}
configure_sphinxsearch()
{
local _dbdir="$ZFS_DATA_MNT/db"
if [ ! -d "$_dbdir" ]; then
mkdir -p "$_dbdir" || exit
fi
tell_status "Setting config to data mount"
stage_sysrc sphinxsearch_conffile="/data/sphinx.conf"
stage_sysrc sphinxsearch_user="www"
stage_sysrc sphinxsearch_group="www"
stage_sysrc sphinxsearch_dir="/data/db/"
}
start_sphinxsearch()
{
tell_status "Enable Sphinxsearch"
stage_sysrc sphinxsearch_enable=YES
#stage_exec service sphinxsearch start
}
base_snapshot_exists || exit
create_staged_fs sphinxsearch
start_staged_jail sphinxsearch
install_sphinxsearch
configure_sphinxsearch
start_sphinxsearch
promote_staged_jail sphinxsearch