forked from mayTermux/lampTermux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·80 lines (56 loc) · 1.55 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
#!/bin/bash
DIR=`cd $(dirname $0); pwd`
source $DIR/.lamp.var
source $DIR/.spinner/spinner.sh
banner
lamptable
install
function config() {
echo -e "⚙️ Replace apache configuration\n"
start_spinner " 📦 httpd.conf"
sleep 2
if cp httpd.conf $PREFIX/etc/apache2/httpd.conf; then
stop_spinner $?
else
sleep 2
cp "empty" > /dev/null 2>&1
stop_spinner $?
fi
echo -e "\n⚙️ Creating htdocs directory on
$HOME/\n"
start_spinner " 📦 /home/apache (htdocs)"
sleep 2
if [[ -d $HOME/apache ]]; then
echo "<?php phpinfo(); ?>" >> $HOME/apache/index.php
stop_spinner $?
else
mkdir $HOME/apache
echo "<?php phpinfo(); ?>" >> $HOME/apache/index.php
stop_spinner $?
fi
echo ""
}
config
function shortexec() {
echo -e "⚙️ Creating shortcut LAMP on
$PREFIX/bin/\n"
for bin in "${bins[@]}"; do
start_spinner " 📦 $bin"
sleep 2
cp $bin $PREFIX/bin/$bin
if [[ -f $PREFIX/bin/$bin ]]; then
stop_spinner $?
else
sleep 2
cp "empty" > /dev/null 2>&1
stop_spinner $?
fi
done
echo ""
}
shortexec
runit
echo -e "⚠️ Restart Termux so that the service-daemon is started."
echo -e "⚠️ On first boot run 'lamp' to start service."
echo -e "⚠️ To check status web server run 'lamp-check'
(require start service first).\n"