-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·62 lines (45 loc) · 2.04 KB
/
install
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
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
read -r -p "This script is potentially dangerous and has only been tested on 1 ubuntu 14.04 server, continue? [y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]
then
# sync files
# src: install dir
# des: /usr/share/pyshared/trac/htdocs/
# desL /usr/share/pyshared/trac/templates/
rsync -aP htdocs/* /usr/share/pyshared/trac/htdocs/
rsync -aP templates/* /usr/share/pyshared/trac/templates/
echo 'DEtrac theme sync [ok]'
# htdocs
# sync symlinks
# src: /usr/share/pyshared/trac/htdocs/
# des: /usr/lib/python2.7/dist-packages/trac/htdocs
rm -r /usr/lib/python2.7/dist-packages/trac/htdocs
ln -s /usr/share/pyshared/trac/htdocs/ /usr/lib/python2.7/dist-packages/trac/htdocs
echo 'htdocs symlink created at /usr/lib/python2.7/dist-packages/trac'
# templates
# sync symlinks
# src: /usr/share/pyshared/trac/templates/
# des: /usr/lib/python2.7/dist-packages/trac/templates
rm -r /usr/lib/python2.7/dist-packages/trac/templates
ln -s /usr/share/pyshared/trac/templates/ /usr/lib/python2.7/dist-packages/trac/templates
echo 'templates symlink created at /usr/lib/python2.7/dist-packages/trac'
sed -i.backup -e '/trac.css/s/^/#/' /usr/share/pyshared/trac/web/chrome.py
sed -i.backup -e '/wiki.css/s/^/#/' /usr/share/pyshared/trac/wiki/web_ui.py
sed -i.backup -e '/timeline.css/s/^/#/' /usr/share/pyshared/trac/timeline/web_ui.py
sed -i.backup -e '/search.css/s/^/#/' /usr/share/pyshared/trac/search/web_ui.py
sed -i.backup -e '/browser.css/s/^/#/' /usr/share/pyshared/trac/versioncontrol/web_ui/browser.py
sed -i.backup -e '/report.css/s/^/#/' /usr/share/pyshared/trac/ticket/report.py
sed -i.backup -e '/ticket.css/s/^/#/' /usr/share/pyshared/trac/ticket/web_ui.py
echo 'edits made to files in /usr/share/pyshared/trac. Originals saved with .backup extension.'
echo 'install complete [ok]'
read -r -p "reload apache? [y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]
then
service apache2 reload
else
echo 'you should reload apache for theme to take effect'
fi
echo 'all [OK]'
else
echo 'bye :)'
fi