forked from GFW4Fun/x-ui-pro
-
Notifications
You must be signed in to change notification settings - Fork 4
/
randomfakehtml.sh
37 lines (37 loc) · 1.14 KB
/
randomfakehtml.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
#!/bin/bash
### https://github.com/GFW4Fun
Green="\033[32m"
Red="\033[31m"
Yellow="\033[33m"
Blue="\033[36m"
Font="\033[0m"
OK="${Green}[OK]${Font}"
ERROR="${Red}[ERROR]${Font}"
function msg_inf() { echo -e "${Blue} $1 ${Font}"; }
function msg_ok() { echo -e "${OK} ${Blue} $1 ${Font}"; }
function msg_err() { echo -e "${ERROR} ${Yellow} $1 ${Font}"; }
###################################
apt install unzip -y
cd $HOME
if [[ -d "randomfakehtml-master" ]]; then
cd randomfakehtml-master
else
wget https://github.com/GFW4Fun/randomfakehtml/archive/refs/heads/master.zip
unzip master.zip && rm master.zip
cd randomfakehtml-master
rm -rf assets
rm ".gitattributes" "README.md" "_config.yml"
fi
###################################
#RandomHTML=$(for i in *; do echo "$i"; done | shuf -n1 2>&1)
RandomHTML=$(a=(*); echo ${a[$((RANDOM % ${#a[@]}))]} 2>&1)
msg_inf "Random template name: ${RandomHTML}"
#################################
if [[ -d "${RandomHTML}" && -d "/var/www/html/" ]]; then
rm -rf /var/www/html/*
cp -a ${RandomHTML}/. "/var/www/html/"
msg_ok "Template extracted successfully!"
else
msg_err "Extraction error!"
fi
#################################