blob: b4fe53289cba49a142baf38a0e3141bd586467c2 (
plain)
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
|
#!/bin/bash
#
# Provisioner
#
# Parameters
DIRNAME="`dirname $0`"
# Basic dependencies
DEPENDENCIES="mkdocs apache2 python3-pip pandoc pandoc-citeproc"
# PyPI dependencies
DEPENDENCIES_PIP="mkdocs-bibtex mkdocs-material mkdocs-awesome-pages-plugin mkdocs-static-i18n mkdocs-macros-plugin"
# Check for sudo
if [ "`whoami`" != "root" ]; then
SUDO="sudo"
fi
# Ensure an up-to-date system
$SUDO apt-get update && $SUDO apt-get dist-upgrade -y && $SUDO apt-get autoremove -y && $SUDO apt-get clean
# Install dependencies
$SUDO apt install -y $DEPENDENCIES
# Install python dependencies
pip3 install $DEPENDENCIES_PIP
# Configure virtual host for the local service
cat <<-EOF | $SUDO tee /etc/apache2/sites-available/local.conf > /dev/null
<VirtualHost *:80>
ServerName estudo.local
DocumentRoot "/srv/shared/site"
<Directory /srv/shared/site>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
EOF
# Enable virtual host
$SUDO a2ensite local
$SUDO systemctl reload apache2
# Configure PATH
mkdir -p ~/.custom
echo 'export PATH=$PATH:/srv/shared/scripts' > ~/.custom/profile
|