Repository navigation
Expand file tree
/
Copy pathxc-install
More file actions
executable file
·265 lines (239 loc) · 6.82 KB
/
Copy pathxc-install
File metadata and controls
executable file
·265 lines (239 loc) · 6.82 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
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
#!/bin/bash
# Author: Daniel Drake <dsd@laptop.org>
# XS auto-usbmount import script for code parts of the e-library
#modified for Rwanda configuration <tony_anderson@usa.net>
set -e
VERBOSE=No
# Log a string via the syslog facility.
log()
{
if test $1 != debug || expr "$VERBOSE" : "[yY]" > /dev/null; then
logger -p user.$1 -t "xc-code[$$]" -- "$2"
echo "$(date "+%F %T") xc-code: $2"
fi
}
error_beep()
{
echo -en '\033[10;1000]\033[11;100]\007' > /dev/console
sleep 0.2
echo -en '\033[10;1000]\033[11;100]\007' > /dev/console
sleep 0.2
echo -en '\033[10]\033[11]' > /dev/console
return 0
}
UM_MOUNTPOINT="/mnt/usb0"
cd "$UM_MOUNTPOINT"/XC
if [ -f xc-iiab/xc-iiab-install ]; then
log notice "Installing IIAB front-end"
cd xc-iiab/
if bash xc-iiab-install; then
log notice "IIAB front-end installed successfully"
else
log notice "IIAB front-end install failed with code $?"
error_beep
fi
cd ../
else
log notice 'IIAB front-end not found'
error_beep
fi
cd "$UM_MOUNTPOINT"/XC
if [ -f xc-knowledge/xc-knowledge-install ]; then
log notice "Installing IIAB content"
cd xc-knowledge/
if bash xc-knowledge-install; then
log notice "IIAB content installed successfully"
else
log notice "IIAB content install failed with code $?"
error_beep
fi
cd ../
else
log notice 'IIAB content not found'
error_beep
fi
cd "$UM_MOUNTPOINT"/XC
if [ -f xc-schoolsite/xc-schoolsite-install ]; then
log notice "Installing schoolsite"
cd xc-schoolsite/
if bash xc-schoolsite-install; then
log notice "Schoolsite installed successfully"
else
log notice "Schoolsite install failed with code $?"
error_beep
fi
cd ../
else
log notice 'Schoolsite not found'
error_beep
fi
cd "$UM_MOUNTPOINT"/XC
if [ -f xc-static/xc-static-install ]; then
log notice "Installing static content"
cd xc-static
if bash xc-static-install; then
log notice "static files installed successfully"
else
log notice "static files install failed with code $?"
error_beep
fi
else
log notice 'static install not found'
error_beep
fi
cd "$UM_MOUNTPOINT"/XC
if [ -f xc-media/xc-media-install ]; then
log notice "Installing media"
cd xc-media/
if bash xc-media-install; then
log notice "media content installed successfully"
else
log notice "media content install failed with code $?"
error_beep
fi
cd ../
else
log notice 'media content not found'
error_beep
fi
cd "$UM_MOUNTPOINT"/XC
if [ -f xc-repo/xc-repo-install ]; then
log notice "Installing Centos 6.2 repo"
cd xc-repo/
if bash xc-repo-install; then
log notice "CentOS 6.2 repo installed successfully"
else
log notice "CentOS 6.2 repo install failed with code $?"
error_beep
fi
cd ../
else
log notice 'CentOS 6.2 repo not found'
error_beep
fi
cd "$UM_MOUNTPOINT"/XC
if [ -f xc-kls/xc-kls-install ]; then
log notice "Installing Karma Learning System"
cd xc-kls
if bash xc-kls-install; then
log notice "Karma Learning System installed successfully"
else
log notice "Karma Laarning System install failed with code $?"
error_beep
fi
else
log notice 'Karma Learning System not found'
error_beep
fi
cd "$UM_MOUNTPOINT"/XC
if [ -f xc-library/xc-library-install ]; then
log notice "Installing library"
cd xc-library
if bash xc-library-install; then
log notice "Library installed successfully"
else
log notice "Library install failed with code $?"
error_beep
fi
else
log notice 'Library not found'
error_beep
fi
cd "$UM_MOUNTPOINT"/XC
if [ -f xc-homeview/xc-homeview-install ]; then
log notice "Installing homeview"
cd xc-homeview
if bash xc-homeview-install; then
log notice "homeview installed successfully"
else
log notice "homeview install failed with code $?"
error_beep
fi
else
log notice 'homeview not found'
error_beep
fi
cd "$UM_MOUNTPOINT"/XC
if [ -f xc-learning/xc-install-learning ]; then
log notice "Installing learning"
cd xc-learning
if bash xc-install-learning; then
log notice "learning installed successfully"
else
log notice "learning install failed with code $?"
error_beep
fi
else
log notice 'learn not found'
error_beep
fi
cd "$UM_MOUNTPOINT"/XC
if [ -f xc-moodle/xc-moodle-install ]; then
log notice "Installing moodle"
cd xc-moodle
if bash xc-moodle-install; then
log notice "moodle installed successfully"
else
log notice "moodle install failed with code $?"
error_beep
fi
else
log notice 'moodle not found'
error_beep
fi
cd "$UM_MOUNTPOINT"/XC
if [ -f xc-itembank/xc-itembank-install ]; then
log notice "Installing Item Bank"
cd xc-itembank
if bash xc-itembank-install; then
log notice "Item Bank installed successfully"
else
log notice "Item Bank install failed with code $?"
error_beep
fi
else
log notice 'itembank not found'
error_beep
fi
cd "$UM_MOUNTPOINT"/XC
if [ -f xc-wiki/xc-wiki4schools-install ]; then
log notice "Installing Wiki4Schools"
cd xc-wiki
if bash xc-wiki4schools-install; then
log notice "wiki4schools installed successfully"
else
log notice "wiki4schools install failed with code $?"
error beep
fi
else
log notice 'xc-wiki not found'
error_beep
fi
cd "$UM_MOUNTPOINT"/XC
if [ -f xc-mediawiki/xc-mediawiki-install ]; then
log notice "Installing Mediawiki"
cd xc-mediawiki
if bash xc-mediawiki-install; then
log notice "Mediawiki installed successfully"
else
log notice "Mediawiki install failed with code $?"
error beep
fi
else
log notice 'xc-mediawiki not found'
error_beep
fi
cd "$UM_MOUNTPOINT"/XC
if [ -f xc-wiktionary/xc-wiktionary-install ]; then
log notice "Installing Wiktionary"
cd xc-wiktionary
if bash xc-wiktionary-install; then
log notice "wiktionary installed successfully"
else
log notice "wiktionary install failed with code $?"
error beep
fi
else
log notice 'xc-wiktionary not found'
error_beep
fi