forked from dclardy64/ISPConfig-3-Debian-Installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththeme_install.sh
54 lines (42 loc) · 1.85 KB
/
theme_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
#!/bin/bash
###############################################################################################
# Theme Installation for ISPConfig 3 setup. #
# Drew Clardy #
# http://drewclardy.com #
###############################################################################################
# Check if user is root
if [ $(id -u) != "0" ]; then
echo "Error: You must be root to run this script, please use the root user to install the software."
exit 1
fi
back_title="ISPConfig 3 Theme Installer"
questions (){
while [ "x$theme" == "x" ]
do
theme=$(whiptail --title "Theme" --backtitle "$back_title" --nocancel --radiolist "Select Theme" 10 50 2 "ISPC-Clean" "(default)" ON "Other" "" OFF 3>&1 1>&2 2>&3)
done
while [ "x$mysql_pass" == "x" ]
do
mysql_pass=$(whiptail --title "MySQL Root Password" --backtitle "$back_title" --inputbox "Please insert the MySQL Root Password" --nocancel 10 50 3>&1 1>&2 2>&3)
done
}
function_install_ISPC_Clean() {
# Get Theme
cd /tmp
wget https://github.com/dclardy64/ISPConfig_Clean-3.0.5/archive/master.zip
unzip master.zip
cd ISPConfig_Clean-3.0.5-master
cp -R interface/* /usr/local/ispconfig/interface/
sed -i "s|\$conf\['theme'\] = 'default'|\$conf\['theme'\] = 'ispc-clean'|" /usr/local/ispconfig/interface/lib/config.inc.php
sed -i "s|\$conf\['logo'\] = 'themes/default|\$conf\['logo'\] = 'themes/ispc-clean|" /usr/local/ispconfig/interface/lib/config.inc.php
mysql -u root -p$mysql_pass < sql/ispc-clean.sql
}
#Execute functions#
if [ -f /etc/debian_version ]; then
questions
if [ $theme == "ISPC-Clean" ]; then
function_install_ISPC_Clean
fi
else echo "Unsupported Linux Distribution."
fi
#End execute functions#