-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphp7.0.sh
47 lines (46 loc) · 1.43 KB
/
php7.0.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
#!/bin/bash
# Created by @_zelsaddr
clear
merah="\033[1;31m"
kunig="\033[1;33m"
hijau="\033[1;32m"
biru="\033[1;34m"
cyan="\033[0;36m"
hapud="\033[0m"
putij="\033[37m"
if [[ $EUID -ne 0 ]]; then
echo -e $merah"[!] This script must be run as root"$hapud
exit 1
fi
echo -ne $kunig"[?] Are you sure? [y/n] "$hapud
read opt
if [[ $opt == "y" ]]; then
PHP_VERSION=$(php -v | grep -i "7.0")
if [[ $PHP_VERSION ]]; then
echo -e $hijau"[!] You already installed PHP 7.0 Version"$hapud
exit 2
fi
echo -e $kunig"[>] Installing Software Properties Common .."$hapud
sleep 1
apt-get install software-properties-common -y &> /dev/null
echo -e $cyan"[>] Add Repository PHP .."$hapud
sleep 1
add-apt-repository ppa:ondrej/php -y &> /dev/null
echo -e $hijau"[>] Updating Repo .."$hapud
sleep 1
apt-get update &> /dev/null
echo -e $biru"[!] Installing all php7.0 requirements .."$hapud
sleep 1
apt-get install php7.0 php7.0-mcrypt php7.0-mbstring php7.0-curl php7.0-cli php7.0-mysql php7.0-gd php7.0-bcmath php7.0-intl php7.0-xsl -y &> /dev/null
phpv=$(php -v | grep -i "7.0")
if [[ $phpv ]]; then
echo -e $cyan"[>] Success Changing PHP Version to 7.0"$hapud
else
echo -e $merah"[!] Failed to Changing PHP Version."$hapud
fi
echo -e $hijau"[!] Done!, Exiting.."$hapud
exit 2
else
echo -e $merah"[!] Okay, Im exiting .."$hapud
exit 2
fi