summaryrefslogtreecommitdiff
path: root/createentities
blob: db9845d8e28bc1d8717babb0f6df051790d70573 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/bash

GROUP="apache"

#
# Create user files
#
if test -f forum/data/users.xml
then
        echo "forum/data/users.xml already exists."
else
	echo "Creating forum/data/users.xml"
	echo "<?xml version='1.0' encoding='UTF-8'?>" > forum/data/users.xml
	echo "<users>" >> forum/data/users.xml
 	echo "  <user enabled='on' uid='0' gid='0' notified='0' username='admin' password='8456c0209aaa9ca04730a3160caf6e5e6b5ea389' name='Administrator' avatar='default.gif' email=''/>" >> forum/data/users.xml
 	echo "</users>" >> forum/data/users.xml
	chgrp $GROUP forum/data/users.xml
	chmod g+wr forum/data/users.xml
fi

if test -f data/users.xml
then
        echo "data/users.xml already exists."
else
        echo "Creating data/users.xml"
        echo "<?xml version='1.0' encoding='UTF-8'?>" > data/users.xml
        echo "<users>" >> data/users.xml
        echo "  <user userid='admin' password='8456c0209aaa9ca04730a3160caf6e5e6b5ea389'/>" >> data/users.xml
        echo "</users>" >> data/users.xml
        chgrp $GROUP data/users.xml
        chmod g+wr data/users.xml
fi



#
# Create config files
#
if test -f htdocs/config.php
then
	echo "htdocs/config.php already exists"
else
        echo "Creating htdocs/config.php"
	cp htdocs/config.php.defaults htdocs/config.php
fi

if test -f forum/htdocs/config.php
then 
        echo "forum/htdocs/config.php already exists"
else
        echo "Creating forum/htdocs/config.php"
        cp forum/htdocs/config.php.defaults forum/htdocs/config.php
fi

#
# Create symlink to forum
#
if test -L htdocs/forum
then
	echo "htdocs/forum symlink already exists"
else
	echo "Creating htdocs/forum symlink"
	(cd htdocs; ln ../forum/htdocs forum -s)
fi


#
# Create a forum
#
if test -d forum/data/forum
then
        echo "forum/data/forum already exists"
else
	mkdir forum/data/forum
	echo "<?xml version='1.0' encoding='UTF-8'?>" > forum/data/forum/forums.xml
	echo "<forums>" >> forum/data/forum/forums.xml
	echo "  <forum fid='1' readlist='1' writelist='1' name='Test Forum'/>" >> forum/data/forum/forums.xml
	echo "</forums>" >> forum/data/forum/forums.xml
	mkdir forum/data/forum/1
	chgrp $GROUP forum/data/forum/1
	chmod g+w forum/data/forum/1
fi

#
# Create imagecache
#
if test -d forum/data/imagecache
then
        echo "forum/data/imagecache already exists"
else
        mkdir forum/data/imagecache
        chgrp $GROUP forum/data/imagecache
        chmod g+w forum/data/imagecache
fi

#
# Create files
#
if test -d forum/data/files
then
        echo "forum/data/files already exists"
else
        mkdir forum/data/files
        chgrp $GROUP forum/data/files
        chmod g+w forum/data/files
fi