-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
72 lines (72 loc) · 2.52 KB
/
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
clear
echo "XeonPanel Panel & Deamon v0.8 Installation Script"
echo "Copyright © 2022 Xeonpanel."
echo "For support join our community: https://discord.gg/4y9X28Ubxd"
sleep 1s
echo ""
if [ "$(id -u)" != "0" ]; then
printf "This script must be run as root\nYou can login as root with\033[0;32m sudo su -\033[0m\n" 1>&2
exit 1
fi
read -p "Are you sure you want to continue? [y/n] " installation
if [[ $installation == "y" || $installation == "Y" || $installation == "yes" || $installation == "Yes" ]]
then
clear
echo "Installing panel ( v0.8 )"
echo ""
sleep 1s
service apache2 stop
service apache stop
sudo apt update
sudo apt-get --ignore-missing install python3 git python3-pip nginx certbot python3-certbot-nginx curl
cd /etc
git clone https://github.com/Xeonpanel/Panel.git xeonpanel
python3 -m pip install flask requests
mv /etc/xeonpanel/xeonpanel.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable --now xeonpanel.service
echo "Installing nginx config..."
clear
read -p 'Enter your domain ( No IP ): ' domain
echo ""
sudo certbot certonly --standalone -d $domain
cp /etc/xeonpanel/xeonpanel.conf /etc/nginx/sites-available/xeonpanel.conf
sed -i "s/url/$domain/" /etc/nginx/sites-available/xeonpanel.conf
ln -s /etc/nginx/sites-available/xeonpanel.conf /etc/nginx/sites-enabled/xeonpanel.conf
systemctl restart nginx
echo "Panel is now available at https://$domain"
sleep 5s
clear
read -p "Do you want to install the deamon? [y/n] " deamon
if [[ $deamon == "y" || $deamon == "Y" || $deamon == "yes" || $deamon == "Yes" ]]
then
sudo apt update
sudo apt --ignore-missing install git python3 python3-pip docker containerd docker.io
python3 -m pip install flask flask_sock flask_cors docker waitress
cd /etc
sudo git clone https://github.com/Xeonpanel/Deamon.git deamon
sudo mv /etc/deamon/deamon.service /etc/systemd/system/
echo "Installing nginx config..."
clear
read -p 'Enter your domain ( No IP ): ' domain
service nginx stop
certbot certonly --standalone -d $domain
cp /etc/deamon/deamon.conf /etc/nginx/sites-available/deamon.conf
sed -i "s/url/$domain/" /etc/nginx/sites-available/deamon.conf
ln -s /etc/nginx/sites-available/deamon.conf /etc/nginx/sites-enabled/deamon.conf
systemctl restart nginx
echo ""
echo " --> Installation completed"
echo ""
else
echo ""
echo "--> The installation was cancelled"
echo ""
fi
else
echo ""
echo " --> Installation cancelled"
echo ""
fi
exit