-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathinstall.sh
500 lines (343 loc) · 17 KB
/
install.sh
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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
#!/bin/sh
# Make a local treeroot node with symlinks for developers
# --- SETINGS: --------------------------------------------------------------------
# PROJECT LOCATION
PROJECT=$(pwd)
SUBETHER="SubEther"
ARENA="ArenaCM"
# PARENT LOCATION
PARENT=$(dirname "$PROJECT")
# LICENSE
LICENSE="AGPLv3"
# DISTRO ENTERPRISE / OPEN SOURCE
DISTRO="treeroot"
# APACHE2 CONFIG LOCATION
CONFIG="/etc/apache2/sites-enabled/000-default.conf"
# USE SYMLINKS
SYMLINKS="0"
# SITE LOCATION EX
SITE="/var/www/html"
BASE_DIR=${SITE}"/$SUBETHER"
# --- STEP 1: ---------------------------------------------------------------------
#git clone https://github.com/FriendUPCloud/ArenaCM
#git clone https://github.com/FriendUPCloud/SubEther
# --- STEP 2: ---------------------------------------------------------------------
sudo apt-get install dialog
BASE_DIR=$(dialog --backtitle "Installer" --inputbox "\
Please enter the install path for treeroot:" 10 55 "$BASE_DIR" --output-fd 1)
if [ $? = "1" ]; then
clear
echo "Aborting installation."
exit 1
fi
if [ "$BASE_DIR" != "$SITE/$SUBETHER" ]; then
SITE=${BASE_DIR}
fi
if [ ! -d ${SITE} ]; then
# If can't find apache2 ask to install it
# If can't find mysql ask to install it
# If can't find apache2 web config create it and setup default
# If can't find php5 ask to install it
# If can't find cUrl doesn't exist ask to install it
# If can't find ffmpeg doesn't exist ask to install it
echo ${SITE}" doesn't exist, aborting installation."
exit 1
fi
if [ ! -d ${PARENT}"/$ARENA" ]; then
echo ${PARENT}"/$ARENA doesn't exist, copy/clone $ARENA repo first, aborting installation."
exit 1
fi
if [ ! -d ${PARENT}"/$SUBETHER" ]; then
echo ${PARENT}"/$SUBETHER doesn't exist, copy/clone $SUBETHER repo first, aborting installation."
exit 1
fi
if [ ! -d ${PARENT}"/$SUBETHER/distro/"${DISTRO} ]; then
LICENSE="AGPLv3"
DISTRO="subether"
else
read -p "Enterprise (Treeroot) distro found, install this instead of the Open Source (SubEther) distro (y/n) ? " CHOOSE_DISTRO
if [ "$CHOOSE_DISTRO" = "n" ]; then
LICENSE="AGPLv3"
DISTRO="subether"
fi
fi
if [ ! -d ${PARENT}"/$SUBETHER/distro/"${DISTRO} ]; then
echo ${PARENT}"/$SUBETHER/distro/"${DISTRO}" doesn't exist, contact support, aborting installation."
exit 1
fi
VERSION="`cat "${PROJECT}"/distro/"${DISTRO}"/version.txt`"
# check system
if cat /etc/*-release | grep ^ID | grep ubuntu; then
echo "Ubuntu distro found"
if cat /etc/*-release | grep ^VERSION_ID | grep 14; then
echo "version 14"
INSTALL_SCRIPT_NUMBER=1
elif cat /etc/*-release | grep ^VERSION_ID | grep 15; then
echo "version 15"
INSTALL_SCRIPT_NUMBER=1
elif cat /etc/*-release | grep ^VERSION_ID | grep 16; then
echo "version 16"
INSTALL_SCRIPT_NUMBER=2
elif cat /etc/*-release | grep ^VERSION_ID | grep 17; then
echo "version 17"
INSTALL_SCRIPT_NUMBER=2
elif cat /etc/*-release | grep ^VERSION_ID | grep 18; then
echo "version 18"
INSTALL_SCRIPT_NUMBER=2
else
echo "version other"
INSTALL_SCRIPT_NUMBER=0
fi
elif cat /etc/*-release | grep ^ID | grep debian; then
echo "Debian distro found"
if cat /etc/*-release | grep ^VERSION_ID | grep 8; then
echo "version 8"
INSTALL_SCRIPT_NUMBER=1
elif cat /etc/*-release | grep ^VERSION_ID | grep 9; then
echo "version 9"
INSTALL_SCRIPT_NUMBER=2
else
echo "version other"
INSTALL_SCRIPT_NUMBER=0
fi
elif cat /etc/*-release | grep ^ID | grep mint; then
echo "Mint distro found"
if cat /etc/*-release | grep ^VERSION_ID | grep 16; then
echo "version 16"
INSTALL_SCRIPT_NUMBER=1
elif cat /etc/*-release | grep ^VERSION_ID | grep 17; then
echo "version 17"
INSTALL_SCRIPT_NUMBER=1
elif cat /etc/*-release | grep ^VERSION_ID | grep 18; then
echo "version 18"
INSTALL_SCRIPT_NUMBER=2
else
echo "version other"
INSTALL_SCRIPT_NUMBER=0
fi
else
INSTALL_SCRIPT_NUMBER=-1
fi
if [ "$INSTALL_SCRIPT_NUMBER" -eq "1" ];then
sudo apt-get install zip apache2 php5 mysql-server libapache2-mod-php php5-mysql php5-gd php5-curl php5-xml ffmpeg rsync
elif [ "$INSTALL_SCRIPT_NUMBER" -eq "2" ];then
sudo apt-get install zip apache2 php mysql-server libapache2-mod-php php-mysql php-gd php-curl php-xml ffmpeg rsync
else
dialog --backtitle "Treeroot installer" --msgbox "Supported linux version not found!\n\n\
Write to us: [email protected]" 8 40
clear
exit 1
fi
#TODO: Make sure upload files also get copied as expected ....
sudo apt-get update
#TODO: Make sure it's possible to use the same installer for later updates
if [ -d ${BASE_DIR}"/subether" ]; then
# Take backup of treeroot
read -p "Do you want to take backup of "${BASE_DIR}" and store it in ${PARENT}/backup."${SUBETHER}" (y/n) ? " BACKUP
if [ "$BACKUP" = "y" ]; then
echo "Taking backup of "${BASE_DIR}
sudo rsync -ravL ${BASE_DIR}/subether ${PARENT}/backup.${SUBETHER}/ > /dev/null
sudo rsync -ravL ${BASE_DIR}/extensions ${PARENT}/backup.${SUBETHER}/ > /dev/null
sudo rsync -ravL ${BASE_DIR}/admin ${PARENT}/backup.${SUBETHER}/ > /dev/null
sudo rsync -ravL ${BASE_DIR}/friend ${PARENT}/backup.${SUBETHER}/ > /dev/null
sudo rsync -ravL ${BASE_DIR}/lib ${PARENT}/backup.${SUBETHER}/ > /dev/null
sudo rsync -ravL ${BASE_DIR}/web ${PARENT}/backup.${SUBETHER}/ > /dev/null
sudo rsync -ravL ${BASE_DIR}/upload ${PARENT}/backup.${SUBETHER}/ > /dev/null
fi
#echo ${BASE_DIR}" exist, aborting installation."
#exit 1
fi
cd ${PROJECT}/distro/${DISTRO}/ && sh makezipdistro.sh
if [ ! -f ${PARENT}"/"${DISTRO}${VERSION}".zip" ]; then
echo ${PARENT}"/"${DISTRO}${VERSION}".zip doesn't exist, aborting installation."
exit 1
fi
read -p "Do you want to use symlinks to link from "${PARENT}"/$ARENA and "${PARENT}"/$SUBETHER to "${BASE_DIR}" (y/n) ? " USE_SYMLINKS
if [ "$USE_SYMLINKS" = "y" ]; then
SYMLINKS="yes"
if [ ! -f ${CONFIG} ]; then
echo ${CONFIG}" doesn't exist, aborting installation."
exit 1
fi
FOLLOW_SYMLINK_FOUND=$(sed -n "/Options FollowSymLinks/p" "$CONFIG")
if [ "$FOLLOW_SYMLINK_FOUND" = "" ]; then
CONFIG_VAR="DocumentRoot $BASE_DIR"
CONFIG_EDIT="\n\n\t<Directory $BASE_DIR>\n\t\tOptions FollowSymLinks\n\t\tAllowOverride All\n\t</Directory>"
echo ${CONFIG_EDIT}
read -p "
To use symlinks the option has to be enabled in the Apache config, do you want to add this under DocumentRoot in $CONFIG (y/n) ? " CONF
if [ "$CONF" = "y" ]; then
sudo sed -i "s|${CONFIG_VAR}|${CONFIG_VAR}${CONFIG_EDIT}|g" $CONFIG
fi
fi
fi
echo "Unziping "${PARENT}"/"${DISTRO}${VERSION}".zip to "${BASE_DIR}
sudo unzip -q ${PARENT}/${DISTRO}${VERSION}.zip -d ${BASE_DIR}/
# --- STEP 3: --------------------------------------------------------------------
echo "Setting privileges"
sudo chmod -R 777 ${BASE_DIR}/upload/
sudo chmod -R 777 ${BASE_DIR}/subether/upload/
sudo chown -R www-data.www-data ${BASE_DIR}/
# --- STEP 4: --------------------------------------------------------------------
if [ "$SYMLINKS" = "yes" ]; then
# TODO: Add .gitignore or something to the repo so you don't have to do this for lib/ and subether/upload/
echo "Removing folders and files in "${BASE_DIR}" that will be symlinked"
sudo rm -rf ${BASE_DIR}/admin
sudo rm -rf ${BASE_DIR}/friend
sudo rm -rf ${BASE_DIR}/web
sudo rm -rf ${BASE_DIR}/extensions/easyeditor
sudo rm -rf ${BASE_DIR}/extensions/editor
sudo rm -rf ${BASE_DIR}/extensions/userlogin
sudo rm -rf ${BASE_DIR}/lib/3rdparty
sudo rm -rf ${BASE_DIR}/lib/classes
#sudo rm -rf ${BASE_DIR}/lib/enterprise
sudo rm -rf ${BASE_DIR}/lib/fonts
sudo rm -rf ${BASE_DIR}/lib/functions
sudo rm -rf ${BASE_DIR}/lib/help
sudo rm -rf ${BASE_DIR}/lib/icons
sudo rm -rf ${BASE_DIR}/lib/include
sudo rm -rf ${BASE_DIR}/lib/javascript
sudo rm -rf ${BASE_DIR}/lib/locale
sudo rm -rf ${BASE_DIR}/lib/plugins
sudo rm -rf ${BASE_DIR}/lib/skeleton
sudo rm -rf ${BASE_DIR}/lib/templates
sudo rm -rf ${BASE_DIR}/lib/themes
sudo rm -f ${BASE_DIR}/lib/core_config.php.example
sudo rm -f ${BASE_DIR}/lib/error.html
sudo rm -f ${BASE_DIR}/lib/error.jpg
sudo rm -f ${BASE_DIR}/lib/htaccess
sudo rm -f ${BASE_DIR}/lib/index.html
sudo rm -f ${BASE_DIR}/lib/install.php
sudo rm -f ${BASE_DIR}/lib/lib.php
sudo rm -f ${BASE_DIR}/lib/resources.php
sudo rm -rf ${BASE_DIR}/upload/template
sudo rm -rf ${BASE_DIR}/extensions/sbook
sudo rm -rf ${BASE_DIR}/extensions/templates
sudo rm -rf ${BASE_DIR}/subether/applications
sudo rm -rf ${BASE_DIR}/subether/classes
sudo rm -rf ${BASE_DIR}/subether/components
sudo rm -rf ${BASE_DIR}/subether/css
sudo rm -rf ${BASE_DIR}/subether/functions
sudo rm -rf ${BASE_DIR}/subether/gfx
sudo rm -rf ${BASE_DIR}/subether/include
sudo rm -rf ${BASE_DIR}/subether/javascript
sudo rm -rf ${BASE_DIR}/subether/locale
sudo rm -rf ${BASE_DIR}/subether/modules
sudo rm -rf ${BASE_DIR}/subether/plugins
sudo rm -rf ${BASE_DIR}/subether/restapi
#sudo rm -rf ${BASE_DIR}/subether/themes
sudo rm -rf ${BASE_DIR}/subether/themes/subether
sudo rm -rf ${BASE_DIR}/subether/themes/friendstore
sudo rm -rf ${BASE_DIR}/subether/thirdparty
sudo rm -f ${BASE_DIR}/MPL.txt
sudo rm -f ${BASE_DIR}/README
sudo rm -f ${BASE_DIR}/config.php.example
sudo rm -f ${BASE_DIR}/.htaccess
sudo rm -f ${BASE_DIR}/robots.txt
sudo rm -f ${BASE_DIR}/subether/install.php
sudo rm -f ${BASE_DIR}/subether/templates/standardemail.php
sudo rm -f ${BASE_DIR}/upload/about.html
sudo rm -f ${BASE_DIR}/upload/terms.html
sudo rm -f ${BASE_DIR}/upload/copyright.html
sudo rm -f ${BASE_DIR}/upload/advertising.html
sudo rm -f ${BASE_DIR}/upload/privacy.html
sudo rm -f ${BASE_DIR}/upload/policy.html
sudo rm -f ${BASE_DIR}/upload/creators.html
sudo rm -f ${BASE_DIR}/upload/developers.html
#sudo rm -f ${BASE_DIR}/upload/images-master/logo_white.png
#sudo rm -f ${BASE_DIR}/upload/images-master/logo_symbol_white.png
#sudo rm -f ${BASE_DIR}/upload/images-master/logo_black.png
#sudo rm -f ${BASE_DIR}/upload/images-master/logo_symbol_black.png
sudo rm -f ${BASE_DIR}/subether/arenadefault.sql
sudo rm -f ${BASE_DIR}/subether/defaultdb.sql
sudo rm -f ${BASE_DIR}/subether/info.txt
sudo rm -f ${BASE_DIR}/subether/version.txt
sudo rm -f ${BASE_DIR}/subether/verification.txt
sudo rm -f ${BASE_DIR}/subether/README.txt
sudo rm -f ${BASE_DIR}/subether/AGPLv3.txt
fi
# --- STEP 5: --------------------------------------------------------------------
if [ "$SYMLINKS" = "yes" ]; then
# TODO: Add .gitignore or something to the repo so you don't have to do this for lib/ and subether/upload/
echo "Adding symlinks from "${PARENT}"/$ARENA to "${BASE_DIR}
echo "Adding symlinks from "${PARENT}"/$SUBETHER to "${BASE_DIR}
sudo ln -s ${PARENT}/${ARENA}/admin ${BASE_DIR}/admin
sudo ln -s ${PARENT}/${ARENA}/friend ${BASE_DIR}/friend
sudo ln -s ${PARENT}/${ARENA}/web ${BASE_DIR}/web
sudo ln -s ${PARENT}/${ARENA}/extensions/easyeditor ${BASE_DIR}/extensions/easyeditor
sudo ln -s ${PARENT}/${ARENA}/extensions/editor ${BASE_DIR}/extensions/editor
sudo ln -s ${PARENT}/${ARENA}/extensions/userlogin ${BASE_DIR}/extensions/userlogin
sudo ln -s ${PARENT}/${ARENA}/lib/3rdparty ${BASE_DIR}/lib/3rdparty
sudo ln -s ${PARENT}/${ARENA}/lib/classes ${BASE_DIR}/lib/classes
#sudo ln -s ${PARENT}/${ARENA}/lib/enterprise ${BASE_DIR}/lib/enterprise
sudo ln -s ${PARENT}/${ARENA}/lib/fonts ${BASE_DIR}/lib/fonts
sudo ln -s ${PARENT}/${ARENA}/lib/functions ${BASE_DIR}/lib/functions
sudo ln -s ${PARENT}/${ARENA}/lib/help ${BASE_DIR}/lib/help
sudo ln -s ${PARENT}/${ARENA}/lib/icons ${BASE_DIR}/lib/icons
sudo ln -s ${PARENT}/${ARENA}/lib/include ${BASE_DIR}/lib/include
sudo ln -s ${PARENT}/${ARENA}/lib/javascript ${BASE_DIR}/lib/javascript
sudo ln -s ${PARENT}/${ARENA}/lib/locale ${BASE_DIR}/lib/locale
sudo ln -s ${PARENT}/${ARENA}/lib/plugins ${BASE_DIR}/lib/plugins
sudo ln -s ${PARENT}/${ARENA}/lib/skeleton ${BASE_DIR}/lib/skeleton
sudo ln -s ${PARENT}/${ARENA}/lib/templates ${BASE_DIR}/lib/templates
sudo ln -s ${PARENT}/${ARENA}/lib/themes ${BASE_DIR}/lib/themes
sudo ln -s ${PARENT}/${ARENA}/lib/core_config.php.example ${BASE_DIR}/lib/core_config.php.example
sudo ln -s ${PARENT}/${ARENA}/lib/error.html ${BASE_DIR}/lib/error.html
sudo ln -s ${PARENT}/${ARENA}/lib/error.jpg ${BASE_DIR}/lib/error.jpg
sudo ln -s ${PARENT}/${ARENA}/lib/htaccess ${BASE_DIR}/lib/htaccess
sudo ln -s ${PARENT}/${ARENA}/lib/index.html ${BASE_DIR}/lib/index.html
sudo ln -s ${PARENT}/${ARENA}/lib/install.php ${BASE_DIR}/lib/install.php
sudo ln -s ${PARENT}/${ARENA}/lib/lib.php ${BASE_DIR}/lib/lib.php
sudo ln -s ${PARENT}/${ARENA}/lib/resources.php ${BASE_DIR}/lib/resources.php
sudo ln -s ${PARENT}/${ARENA}/MPL.txt ${BASE_DIR}/MPL.txt
sudo ln -s ${PARENT}/${ARENA}/README ${BASE_DIR}/README
sudo ln -s ${PARENT}/${ARENA}/config.php.example ${BASE_DIR}/config.php.example
sudo ln -s ${PARENT}/${ARENA}/lib/htaccess ${BASE_DIR}/.htaccess
sudo ln -s ${PARENT}/${SUBETHER}/upload/template ${BASE_DIR}/upload/template
sudo ln -s ${PARENT}/${SUBETHER}/extensions/sbook ${BASE_DIR}/extensions/sbook
sudo ln -s ${PARENT}/${SUBETHER}/extensions/templates ${BASE_DIR}/extensions/templates
sudo ln -s ${PARENT}/${SUBETHER}/subether/applications ${BASE_DIR}/subether/applications
sudo ln -s ${PARENT}/${SUBETHER}/subether/classes ${BASE_DIR}/subether/classes
sudo ln -s ${PARENT}/${SUBETHER}/subether/components ${BASE_DIR}/subether/components
sudo ln -s ${PARENT}/${SUBETHER}/subether/css ${BASE_DIR}/subether/css
sudo ln -s ${PARENT}/${SUBETHER}/subether/functions ${BASE_DIR}/subether/functions
sudo ln -s ${PARENT}/${SUBETHER}/subether/gfx ${BASE_DIR}/subether/gfx
sudo ln -s ${PARENT}/${SUBETHER}/subether/include ${BASE_DIR}/subether/include
sudo ln -s ${PARENT}/${SUBETHER}/subether/javascript ${BASE_DIR}/subether/javascript
sudo ln -s ${PARENT}/${SUBETHER}/subether/locale ${BASE_DIR}/subether/locale
sudo ln -s ${PARENT}/${SUBETHER}/subether/modules ${BASE_DIR}/subether/modules
sudo ln -s ${PARENT}/${SUBETHER}/subether/plugins ${BASE_DIR}/subether/plugins
sudo ln -s ${PARENT}/${SUBETHER}/subether/restapi ${BASE_DIR}/subether/restapi
#sudo ln -s ${PARENT}/${SUBETHER}/subether/themes ${BASE_DIR}/subether/themes
sudo ln -s ${PARENT}/${SUBETHER}/subether/themes/subether ${BASE_DIR}/subether/themes/subether
sudo ln -s ${PARENT}/${SUBETHER}/subether/themes/friendstore ${BASE_DIR}/subether/themes/friendstore
sudo ln -s ${PARENT}/${SUBETHER}/subether/thirdparty ${BASE_DIR}/subether/thirdparty
sudo ln -s ${PARENT}/${SUBETHER}/subether/install.php ${BASE_DIR}/subether/install.php
sudo ln -s ${PARENT}/${SUBETHER}/distro/${DISTRO}/standardemail.php ${BASE_DIR}/subether/templates/standardemail.php
sudo ln -s ${PARENT}/${SUBETHER}/distro/${DISTRO}/about.html ${BASE_DIR}/upload/about.html
sudo ln -s ${PARENT}/${SUBETHER}/distro/${DISTRO}/terms.html ${BASE_DIR}/upload/terms.html
sudo ln -s ${PARENT}/${SUBETHER}/distro/${DISTRO}/copyright.html ${BASE_DIR}/upload/copyright.html
sudo ln -s ${PARENT}/${SUBETHER}/distro/${DISTRO}/advertising.html ${BASE_DIR}/upload/advertising.html
sudo ln -s ${PARENT}/${SUBETHER}/distro/${DISTRO}/privacy.html ${BASE_DIR}/upload/privacy.html
sudo ln -s ${PARENT}/${SUBETHER}/distro/${DISTRO}/policy.html ${BASE_DIR}/upload/policy.html
sudo ln -s ${PARENT}/${SUBETHER}/distro/${DISTRO}/creators.html ${BASE_DIR}/upload/creators.html
sudo ln -s ${PARENT}/${SUBETHER}/distro/${DISTRO}/developers.html ${BASE_DIR}/upload/developers.html
#sudo ln -s ${PARENT}/${SUBETHER}/distro/${DISTRO}/logo_white.png ${BASE_DIR}/upload/images-master/logo_white.png
#sudo ln -s ${PARENT}/${SUBETHER}/distro/${DISTRO}/logo_symbol_white.png ${BASE_DIR}/upload/images-master/logo_symbol_white.png
#sudo ln -s ${PARENT}/${SUBETHER}/distro/${DISTRO}/logo_black.png ${BASE_DIR}/upload/images-master/logo_black.png
#sudo ln -s ${PARENT}/${SUBETHER}/distro/${DISTRO}/logo_symbol_black.png ${BASE_DIR}/upload/images-master/logo_symbol_black.png
sudo ln -s ${PARENT}/${SUBETHER}/distro/${DISTRO}/robots.txt ${BASE_DIR}/robots.txt
sudo ln -s ${PARENT}/${SUBETHER}/distro/${DISTRO}/arenadefault.sql ${BASE_DIR}/subether/arenadefault.sql
sudo ln -s ${PARENT}/${SUBETHER}/distro/${DISTRO}/defaultdb.sql ${BASE_DIR}/subether/defaultdb.sql
sudo ln -s ${PARENT}/${SUBETHER}/distro/${DISTRO}/info.txt ${BASE_DIR}/subether/info.txt
sudo ln -s ${PARENT}/${SUBETHER}/distro/${DISTRO}/version.txt ${BASE_DIR}/subether/version.txt
sudo ln -s ${PARENT}/${SUBETHER}/distro/${DISTRO}/verification.txt ${BASE_DIR}/subether/verification.txt
sudo ln -s ${PARENT}/${SUBETHER}/distro/${DISTRO}/README.txt ${BASE_DIR}/subether/README.txt
sudo ln -s ${PARENT}/${SUBETHER}/distro/${DISTRO}/${LICENSE}.txt ${BASE_DIR}/subether/${LICENSE}.txt
fi
# --- STEP 6: --------------------------------------------------------------------
echo "Adding allow rewite addon for apache2"
sudo a2enmod rewrite
# --- STEP 7: --------------------------------------------------------------------
sudo service apache2 restart
xdg-open http://localhost/${SUBETHER}/