From 4b8bd6001b1eb3e0510766cad83527463582d2fd Mon Sep 17 00:00:00 2001 From: DAWARAli1 <165103157+DAWARAli1@users.noreply.github.com> Date: Wed, 25 Sep 2024 07:22:14 +0500 Subject: [PATCH] Create IPTV on XUI with M3U --- IPTV on XUI with M3U | 106 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 IPTV on XUI with M3U diff --git a/IPTV on XUI with M3U b/IPTV on XUI with M3U new file mode 100644 index 0000000..c65ea1a --- /dev/null +++ b/IPTV on XUI with M3U @@ -0,0 +1,106 @@ +#!/bin/bash + +# VPS details and MySQL credentials +VPS_IP="148.72.133.92" +MYSQL_USER="gRkzgQH2nQEarnJsyxWSFePmvzZH349t" +MYSQL_PASS="YZTMEMahk87QsuPB8ACrwG6J764cmpQY" +M3U_URL="http://yalangurbet.com:2086/get.php?username=skyp333&password=anRQFRDc4jwSW&type=m3u_plus&output=mpegts" + +# Step 1: Update server and install necessary packages +apt-get update -y +apt-get upgrade -y + +# Install MySQL or MariaDB and ffmpeg (for stream checking) +apt-get install -y mariadb-server mariadb-client ffmpeg curl nginx + +# Step 2: Start and secure MySQL installation +systemctl start mariadb +systemctl enable mariadb + +# Secure MySQL installation (non-interactive) +mysql_secure_installation < /dev/null 2>&1 +if [ $? -eq 0 ]; then + echo "Stream check passed: The M3U stream is working." +else + echo "Stream check failed: The M3U stream is not accessible or invalid." +fi + +# Step 9: Create an admin page and allow anonymous users to view it +cat <> /var/www/html/admin.html + +Admin Page + +

Welcome to the Admin Page

+

Stream URL: $M3U_URL

+ + +EOT + +# Step 10: Modify Nginx to allow access to the admin page +echo "location /admin { + root /var/www/html; + index admin.html; + allow all; +}" >> /etc/nginx/sites-available/xui.conf + +# Step 11: Test Nginx configuration and restart Nginx +nginx -t +if [ $? -eq 0 ]; then + systemctl restart nginx +else + echo "Nginx configuration test failed. Fix the errors before restarting." +fi + +# Output the XUI panel access URL and admin page URL +echo "XUI panel setup is complete." +echo "Access your panel at http://$VPS_IP:8080" +echo "Admin page available at http://$VPS_IP/admin"