-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·47 lines (35 loc) · 1.06 KB
/
install.sh
File metadata and controls
executable file
·47 lines (35 loc) · 1.06 KB
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
#!/bin/sh
set -e
ensure_dirs ()
{
for j in "$@"; do
test -d "$j" || mkdir -p "$j"
done;
}
check_files_exist ()
{
for j in "$@"; do
if [ -f "$j" ]; then
true
else
echo "File $j not found - unable to install"
exit 1
fi
done;
}
echo "Obtaining directory for semdict.service"
SYSTEMD_DIR=`pkg-config systemd --variable=systemdsystemunitdir`
check_files_exist semdict semdict.service semdict.config.json.example templates/general.t.html
ensure_dirs /etc/semdict /usr/share/semdict/templates
cp semdict /usr/bin
cp semdict.service $SYSTEMD_DIR
CONFIG_FILE=/etc/semdict/semdict.config.json
cp semdict.config.json.example ${CONFIG_FILE}.example
chmod 600 ${CONFIG_FILE}.example
cp -R templates /usr/share/semdict/
cp -R static /usr/share/semdict
systemctl daemon-reload
echo Sample config is ${CONFIG_FILE}.example. To run semdict,
echo You must provide ${CONFIG_FILE}. Don\'t forget to make it
echo secure, e.g. with «sudo chmod 600».
echo To run semdict, use «sudo service semdict start»