-
Notifications
You must be signed in to change notification settings - Fork 0
/
xampp-installer.sh
60 lines (47 loc) · 2.09 KB
/
xampp-installer.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
#!/bin/bash
# --------------------------------------
# @name: XAMPP Ubuntu installer
# @Description: XAMPP Ubuntu installer script, downloads required packages, creates icon and leaves ready to use.
# @author: [email protected]
# @version: 0.0.1
# --------------------------------------
clear
echo ""
echo ""
echo " __ __ _ __ __ ___ ___ _ _ ___ _ _ _ _ _____ _ _ _ _ _ _ "
echo " \ \/ / /_\ | \/ | | _ \ | _ \ ___ | | | | | _ ) | | | | | \| | |_ _| | | | | (_) _ _ ___ | |_ __ _ | | | | ___ _ _ "
echo " > < / _ \ | |\/| | | _/ | _/ |___| | |_| | | _ \ | |_| | | .\ | | | | |_| | | | | ' \ (_-< | _| / _\ | | | | | / -_) | '_|"
echo " /_/\_\ /_/ \_\ |_| |_| |_| |_| \___/ |___/ \___/ |_|\_| |_| \___/ |_| |_||_| /__/ \__| \__,_| |_| |_| \___| |_| "
echo ""
echo ""
# Uncommment for old ubuntu version < 17.10
# which gksu > /dev/null 2>&1
# if [ $? != 0 ]
# then
# echo "gksu is not installed. "
# sudo apt-get install gksu
# fi
echo ""
echo ""
cd /tmp
echo "------> Downloading installer in" $(pwd) "..."
echo ""
echo -n "------> Default PHP version 7, prefer PHP5? (y/N): "
read answer
if [ "$answer" != "${answer#[Yy]}" ] ;then
wget https://www.apachefriends.org/xampp-files/5.6.33/xampp-linux-x64-5.6.33-0-installer.run
XAMPP_INSTALLER_FILE="xampp-linux-x64-5.6.33-0-installer.run"
else
wget https://www.apachefriends.org/xampp-files/7.2.2/xampp-linux-x64-7.2.2-0-installer.run
XAMPP_INSTALLER_FILE="xampp-linux-x64-7.2.2-0-installer.run"
fi
echo ""
echo "------> Giving installer sudo permissions..."
sudo chmod +x $XAMPP_INSTALLER_FILE
echo ""
echo "------> Running installer..."
nohup sudo ./$XAMPP_INSTALLER_FILE &
wait
echo ""
echo "------> Creating launcher..."
echo "[Desktop Entry]\n Version=1.0\n Name=xampp\n Exec=pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY /opt/lampp/manager-linux-x64.run\n Icon=/opt/lampp/htdocs/favicon.ico\n Type=Application\n Categories=Application" | sudo tee /usr/share/applications/xampp.desktop