forked from tbaldur/cyberpanel-mods
-
Notifications
You must be signed in to change notification settings - Fork 2
/
phpmod.sh
67 lines (67 loc) · 2.3 KB
/
phpmod.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
#!/bin/bash
echo "Default PHP version changer for cyberpanel apps"
echo "Version chosen here will be used for phpmyadmin / snappymail"
echo ""
## read php version from input and configures it
read -r -p "Choose one of the following php versions [71-72-73-74-80-81]: " Input_Number
echo ""
case "$Input_Number" in
71)
if [ -f /usr/local/lsws/lsphp71/bin/lsphp ]; then
rm -f /usr/local/lscp/fcgi-bin/lsphp &&
ln -s /usr/local/lsws/lsphp71/bin/lsphp /usr/local/lscp/fcgi-bin/lsphp
echo "Changed default version to $Input_Number"
else
echo "ERROR! Missing php 7.1? Check if /usr/local/lsws/lsphp71 exists."
fi
;;
72)
if [ -f /usr/local/lsws/lsphp72/bin/lsphp ]; then
rm -f /usr/local/lscp/fcgi-bin/lsphp &&
ln -s /usr/local/lsws/lsphp72/bin/lsphp /usr/local/lscp/fcgi-bin/lsphp
echo "Changed default version to $Input_Number"
else
echo "ERROR! Missing php 7.2? Check if /usr/local/lsws/lsphp72 exists."
fi
;;
73)
if [ -f /usr/local/lsws/lsphp73/bin/lsphp ]; then
rm -f /usr/local/lscp/fcgi-bin/lsphp &&
ln -s /usr/local/lsws/lsphp73/bin/lsphp /usr/local/lscp/fcgi-bin/lsphp
echo "Changed default version to $Input_Number"
else
echo "ERROR! Missing php 7.3? Check if /usr/local/lsws/lsphp73 exists."
fi
;;
74)
if [ -f /usr/local/lsws/lsphp74/bin/lsphp ]; then
rm -f /usr/local/lscp/fcgi-bin/lsphp &&
ln -s /usr/local/lsws/lsphp74/bin/lsphp /usr/local/lscp/fcgi-bin/lsphp
echo "Changed default version to $Input_Number"
else
echo "ERROR! Missing php 7.4? Check if /usr/local/lsws/lsphp74 exists."
fi
;;
80)
if [ -f /usr/local/lsws/lsphp80/bin/lsphp ]; then
rm -f /usr/local/lscp/fcgi-bin/lsphp &&
ln -s /usr/local/lsws/lsphp80/bin/lsphp /usr/local/lscp/fcgi-bin/lsphp
echo "Changed default version to $Input_Number"
else
echo "ERROR! Missing php 8.0? Check if /usr/local/lsws/lsphp80 exists."
fi
;;
81)
if [ -f /usr/local/lsws/lsphp81/bin/lsphp ]; then
rm -f /usr/local/lscp/fcgi-bin/lsphp &&
ln -s /usr/local/lsws/lsphp81/bin/lsphp /usr/local/lscp/fcgi-bin/lsphp
echo "Changed default version to $Input_Number"
else
echo "ERROR! Missing php 8.1? Check if /usr/local/lsws/lsphp81 exists."
fi
;;
*)
echo -e " Please write php version in the following format [71-72-73-74-80-81]\n"
exit
;;
esac