forked from DRM-Scripts/DRMPHP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
installer-beta_2004.sh
131 lines (110 loc) · 4.6 KB
/
installer-beta_2004.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/bin/bash
#-- UBUNTU 20.04 ONLY --
echo "############################################################################################"
echo "# DRMPHP 0.1 BY DRMSCRIPTS COMMUNITY - HTTPS://DRMSCRIPTS.COM #"
echo "# THIS INSTALL IS BASED ON INSTALLING ALL FILES IN PANEL FOLDER TO THE ROOT OF HTML FOLDER #"
echo "############################################################################################"
echo "############################################################################################"
echo "# For Hetzner please change your source.list in /etc/apt/source.list to the following: #"
echo "# deb http://mirror.hetzner.de/ubuntu/packages focal main restricted #"
echo "# deb http://mirror.hetzner.de/ubuntu/packages focal-updates main restricted #"
echo "############################################################################################"
read -p "Are you sure already change your source.list? (y/n)" answer
# Check the user's response
if [[ "$answer" =~ ^[yY]$ ]] || [[ "$answer" =~ ^[yY][eE][sS]$ ]]; then
echo "Confirmed. Proceeding..."
# Your code here
else
echo "Confirmation declined. Aborting."
exit
# Handle the rejection or exit the script
fi
echo "####################################################"
echo "# INSTALL STEP 1: REPOS, PACKAGES & PANEL DOWNLOAD #"
echo "####################################################"
# Add Repos
apt update -y
apt install git -y;
apt install software-properties-common -y;
add-apt-repository ppa:ondrej/php -y;
add-apt-repository ppa:ondrej/apache2 -y;
# Remove any pending packages
apt-get autoremove;
# Run an update
apt-get update -y;
apt full-upgrade -y;
# Install MySQL, Apache2 & Aria2
apt install mysql-server apache2 aria2 -y;
a2dismod mpm_event;
apt-get install php7.4 php7.4-cli php7.4-json php7.4-common php7.4-mysql php7.4-zip php7.4-gd php7.4-mbstring php7.4-curl php7.4-xml php7.4-bcmath php7.4-bz2 php7.4-xmlrpc -y;
# Download Panel
cd /home;
git clone https://github.com/Random-Code-Guy/DRMPHP;
echo "####################################################";
echo "# INSTALL STEP 2: MYSQL, SHORTTAGS, FFMPEG & PANEL #";
echo "####################################################";
#setup sql cnf
content="[mysqld]\nsql-mode=\"NO_ENGINE_SUBSTITUTION\"\n";
echo -e "$content" | tee /etc/mysql/my.cnf > /dev/null;
service mysql restart;
echo "MySQL configured successfully!";
#setup php.ini
sed -i -r 's/short_open_tag = Off$/short_open_tag = On/' /etc/php/7.4/cli/php.ini;
sed -i -r 's/short_open_tag = Off/short_open_tag = On/g' /etc/php/7.4/apache2/php.ini;
echo "php.ini configured successfully!";
#setup sudoers
line="www-data ALL=(ALL) NOPASSWD: ALL";
sed -i "$ a $line" /etc/sudoers;
echo "Sudoers configured successfully!";
service apache2 restart;
cd /home;
#download and setup ffmpeg
wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz;
tar -xf ffmpeg-release-amd64-static.tar.xz;
cp -r ffmpeg-6.0-amd64-static/* /usr/bin;
echo "FFMpeg configured successfully!";
cd DRM*;
cp -r panel/. /var/www/html;
cd /var/www/html;
chmod +x mp4decrypt;
mkdir download;
chmod 777 download;
cd ../;
mkdir backup;
chmod 777 backup;
chmod 777 html;
cd /home;
cd DRM*;
cp panel/downloader.php /var/www/html;
echo "Panel configured successfully!";
echo "####################################################";
echo "# INSTALL STEP 3: MYSQL DATABASE SETUP #";
echo "####################################################";
cd /home/DRMPHP;
chmod 777 ./db.sh;
sed -i -e 's/\r$//' db.sh;
./db.sh;
echo "Database configured successfully!";
echo "####################################################";
echo "# INSTALL STEP 4: CLEANUP #";
echo "####################################################";
#delete default apache page
rm /var/www/html/index.html;
echo
echo
echo "####################################################";
echo "# INSTALLATION COMPLETE #";
echo "####################################################";
echo
echo
#--ACCESS
public_ip=$(wget -q "http://api.ipify.org" -O -);
echo "####################################################";
echo "# PANEL DETAILS #";
echo "####################################################";
echo "# USER: admin #";
echo "# PASS: Admin@2023## #";
echo "# URL: http://$public_ip/login.php #";
echo "####################################################";
echo "# NOTE: EDIT <M3U8 Download URL> IN SETTINGS PAGE #";
echo "####################################################";