Skip to content

Commit

Permalink
new option - speedtest + google recaptcha
Browse files Browse the repository at this point in the history
  • Loading branch information
MHSanaei committed Apr 3, 2023
1 parent 2dd203e commit 7c98034
Showing 1 changed file with 42 additions and 15 deletions.
57 changes: 42 additions & 15 deletions x-ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -677,20 +677,20 @@ ssl_cert_issue_by_cloudflare() {
LOGE "issue cert failed,exit"
rm -rf ~/.acme.sh/${CF_Domain}
exit 1
else
LOGI "Certificate issued Successfully, Installing..."
fi
~/.acme.sh/acme.sh --installcert -d ${CF_Domain} -d *.${CF_Domain} \
--key-file /root/cert/${CF_Domain}/privkey.pem \
--fullchain-file /root/cert/${CF_Domain}/fullchain.pem
else
LOGI "Certificate issued Successfully, Installing..."
fi
~/.acme.sh/acme.sh --installcert -d ${CF_Domain} -d *.${CF_Domain} \
--key-file /root/cert/${CF_Domain}/privkey.pem \
--fullchain-file /root/cert/${CF_Domain}/fullchain.pem

if [ $? -ne 0 ]; then
LOGE "install cert failed,exit"
rm -rf ~/.acme.sh/${CF_Domain}
exit 1
else
LOGI "Certificate installed Successfully,Turning on automatic updates..."
fi
if [ $? -ne 0 ]; then
LOGE "install cert failed,exit"
rm -rf ~/.acme.sh/${CF_Domain}
exit 1
else
LOGI "Certificate installed Successfully,Turning on automatic updates..."
fi
~/.acme.sh/acme.sh --upgrade --auto-upgrade
if [ $? -ne 0 ]; then
LOGE "auto renew failed, certs details:"
Expand All @@ -706,6 +706,25 @@ ssl_cert_issue_by_cloudflare() {
show_menu
fi
}
google_recaptcha() {
curl -O https://raw.githubusercontent.com/jinwyp/one_click_script/master/install_kernel.sh && chmod +x ./install_kernel.sh && ./install_kernel.sh
echo ""
before_show_menu
}

run_speedtest() {
# Check if Speedtest is already installed
if ! command -v speedtest &> /dev/null; then
# If not installed, install it
sudo apt-get update && sudo apt-get install -y curl
curl -s https://install.speedtest.net/app/cli/install.deb.sh | sudo bash
sudo apt-get install -y speedtest
fi

# Run Speedtest
speedtest
}


show_usage() {
echo "x-ui control menu usages: "
Expand Down Expand Up @@ -751,9 +770,11 @@ show_menu() {
${green}16.${plain} Apply for an SSL Certificate
${green}17.${plain} Update Geo Files
${green}18.${plain} Active Firewall and open ports
${green}19.${plain} Fixing Google reCAPTCHA
${green}20.${plain} Speedtest by Ookla
"
show_status
echo && read -p "Please enter your selection [0-18]: " num
echo && read -p "Please enter your selection [0-20]: " num

case "${num}" in
0)
Expand Down Expand Up @@ -813,8 +834,14 @@ show_menu() {
18)
open_ports
;;
19)
google_recaptcha
;;
20)
run_speedtest
;;
*)
LOGE "Please enter the correct number [0-18]"
LOGE "Please enter the correct number [0-20]"
;;
esac
}
Expand Down

1 comment on commit 7c98034

@Shellgate
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

عالی

Please sign in to comment.