forked from mayTermux/lampTermux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.lamp.var
executable file
·129 lines (88 loc) · 3.29 KB
/
.lamp.var
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
#!/bin/bash
df="\e[39m"
wh="\e[97m"
lrd="\e[91m"
lgn="\e[92m"
lyw="\e[93m"
DIR=`cd $(dirname $0); pwd`
source $DIR/.spinner/spinner.sh
packages=(
"php-apache"
"mariadb"
"php"
"phpmyadmin"
)
bins=(
"lamp"
"lamp-check"
)
function banner() {
echo -e " _ $lrd _______ $df "
echo -e "| | $lrd (_______)$df "
echo -e "| | _____ ____ ____ _ _____ ____ ____ _ _ _ _ "
echo -e "| |(____ | \| _ \| | ___ |/ ___) \| | | ( \ / )"
echo -e "| |/ ___ | | | | |_| | | ____| | | | | | |_| |) X ( "
echo -e " \_)_____|_|_|_| __/|_|\e[39m_____)_| |_|_|_|____/(_/ \_)"
echo -e " |_| \n"
echo -e " Version : 1.0"
echo -e " Build Date : 6 March 2021"
echo -e " Type : Installer\n"
}
function install() {
echo -e "\n⚙️ Installing LAMP Package\n"
for package in "${packages[@]}"; do
start_spinner " 📦 $package"
sleep 2
pkg install -y $package &>/dev/null
function check() {
local ipkg=$(pkg list-installed $package 2> /dev/null | tail -n 1)
local cpkg=${ipkg%/*}
if [[ $cpkg == $package ]]; then
stop_spinner $? || exit 1;
else
sleep 2
cp "empty" > /dev/null 2>&1
stop_spinner $?
start_spinner " 📦 $fullpkg (retrying) "
pkg install -y $package &>/dev/null
check
fi
}
check
done
echo ""
}
function lamptable() {
echo -e " ╭─────────────────────────────╮"
echo -e " ┃ LAMP Package ▎ Size ┃"
echo -e " ╰─────────────────────────────╯"
for lamppkg in ${packages[@]}; do
name=$(apt show $lamppkg 2> /dev/null | sed -n 1p | awk '{print $2}')
size=$(apt show $lamppkg 2> /dev/null | grep Installed-Size: | awk '{print $2$3}')
printf " ┃ %-10s ▎ %6s ┃\n" $name $size
done
echo -e " ╰─────────────────────────────╯"
echo ""
}
function runit() {
echo -e "⚙️ Installing Runit Service (autostart)\n"
start_spinner " 📦 termux-services"
sleep 2
pkg install -y termux-services &>/dev/null
function check() {
local ipkg=$(pkg list-installed termux-services 2> /dev/null | tail -n 1)
local cpkg=${ipkg%/*}
if [[ $cpkg == termux-services ]]; then
stop_spinner $? || exit 1;
else
sleep 2
cp "empty" > /dev/null 2>&1
stop_spinner $?
start_spinner " 📦 termux-services (retrying)"
pkg install -y termux-services &>/dev/null
check
fi
}
check
echo ""
}