Line | |
---|
1 | #!/bin/sh |
---|
2 | |
---|
3 | set -e |
---|
4 | |
---|
5 | |
---|
6 | case $1 in |
---|
7 | |
---|
8 | configure) |
---|
9 | # mp3 dirs permissions |
---|
10 | chown root:www-data /opt/jocomunico/mp3 |
---|
11 | chmod 2775 /opt/jocomunico/mp3 |
---|
12 | |
---|
13 | # Create html if it does not exists |
---|
14 | OLDERDOCUMENTROOT=0; |
---|
15 | if [ ! -d /var/www/html ]; then |
---|
16 | mkdir /var/www/html |
---|
17 | OLDERDOCUMENTROOT=1; |
---|
18 | fi |
---|
19 | |
---|
20 | # Creating links for /var/www |
---|
21 | [ -s /var/www/html/jocomunico ] || ln -s /opt/jocomunico /var/www/html/jocomunico |
---|
22 | |
---|
23 | if [ $OLDERDOCUMENTROOT -eq 1 ]; then |
---|
24 | [ -s /var/www/jocomunico ] || ln -s /var/www/html/jocomunico /var/www/jocomunico |
---|
25 | fi |
---|
26 | |
---|
27 | # Enable modules? |
---|
28 | a2enmod-lliurex rewrite |
---|
29 | a2enmod-lliurex headers |
---|
30 | a2ensite-lliurex jocomunico # if is not enables // WIP |
---|
31 | |
---|
32 | # To fix: WIP! |
---|
33 | echo "127.0.0.1 jocomunico" >> /etc/hosts |
---|
34 | |
---|
35 | # Reloading apache |
---|
36 | systemctl restart apache2-lliurex |
---|
37 | |
---|
38 | # Setting up database |
---|
39 | lliurex-sgbd --db_is_present jocomunicolliureX |
---|
40 | if [ ! -f /tmp/db_is_present ]; then |
---|
41 | lliurex-sgbd --install jocomunicolliureX |
---|
42 | else |
---|
43 | #zenity --info --text="$MSG_MOODLE_AVISO" & |
---|
44 | lliurex-sgbd --upgrade jocomunicolliureX |
---|
45 | fi |
---|
46 | ;; |
---|
47 | |
---|
48 | abort-upgrade|abort-remove|abort-deconfigure) |
---|
49 | echo "postinst called with argument \`$1'" >&2 |
---|
50 | exit 1 |
---|
51 | ;; |
---|
52 | |
---|
53 | *) |
---|
54 | echo "postinst called with unknown argument \`$1'" >&2 |
---|
55 | exit 1 |
---|
56 | ;; |
---|
57 | esac |
---|
58 | |
---|
59 | |
---|
60 | |
---|
61 | #DEBHELPER# |
---|
62 | exit 0 |
---|
Note: See
TracBrowser
for help on using the repository browser.