-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall
43 lines (38 loc) · 1.1 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
#!/usr/bin/env bash
# install file for astro-quiz
# https://github.com/pbrus/astro-quiz
CURRENT_DIR=`pwd`
INSTALL_FILE=install
HTTPD_CONF=/opt/lampp/etc/httpd.conf
if [ ! -e ${HTTPD_CONF} ]
then
echo -e "\n\tError: Installation has corrupted. File ${HTTPD_CONF} doesn't exist."
echo -e "\tCheck localization of httpd.conf file (created during XAMPP installation)."
exit
else
sed -e 's,\(DocumentRoot \"\).*\(\"\),\1'${CURRENT_DIR}'\2,' -e '1,300 s,\(Directory "\).*\(">\),\1'${CURRENT_DIR}'\2,' ${HTTPD_CONF} > ${HTTPD_CONF}.tmp
mv ${HTTPD_CONF}.tmp ${HTTPD_CONF}
mv -f vendor/pbrus/astro-quiz/* .
rm -rf vendor/pbrus
composer dump-autoload
chmod 666 database/database
/opt/lampp/lampp restart
echo -e "\n\tThe installation has been completed."
fi
while :
do
echo -e "\n\tDelete this install file? [y/n]: "
read ans
if [ "$ans" == "y" ]
then
rm ${INSTALL_FILE}
if [ ! -e ${INSTALL_FILE} ]
then
echo -e "\n\tThe install file has been removed."
fi
break
elif [ "$ans" == "n" ]
then
break
fi
done