mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-05-02 21:28:49 +00:00
speedtest - snap install
This commit is contained in:
parent
5a4a42aeb8
commit
9b58277945
1 changed files with 31 additions and 23 deletions
10
x-ui.sh
10
x-ui.sh
|
@ -1238,7 +1238,13 @@ ssl_cert_issue_CF() {
|
||||||
run_speedtest() {
|
run_speedtest() {
|
||||||
# Check if Speedtest is already installed
|
# Check if Speedtest is already installed
|
||||||
if ! command -v speedtest &>/dev/null; then
|
if ! command -v speedtest &>/dev/null; then
|
||||||
# If not installed, install it
|
# If not installed, determine installation method
|
||||||
|
if command -v snap &>/dev/null; then
|
||||||
|
# Use snap to install Speedtest
|
||||||
|
echo "Installing Speedtest using snap..."
|
||||||
|
snap install speedtest
|
||||||
|
else
|
||||||
|
# Fallback to using package managers
|
||||||
local pkg_manager=""
|
local pkg_manager=""
|
||||||
local speedtest_install_script=""
|
local speedtest_install_script=""
|
||||||
|
|
||||||
|
@ -1260,10 +1266,12 @@ run_speedtest() {
|
||||||
echo "Error: Package manager not found. You may need to install Speedtest manually."
|
echo "Error: Package manager not found. You may need to install Speedtest manually."
|
||||||
return 1
|
return 1
|
||||||
else
|
else
|
||||||
|
echo "Installing Speedtest using $pkg_manager..."
|
||||||
curl -s $speedtest_install_script | bash
|
curl -s $speedtest_install_script | bash
|
||||||
$pkg_manager install -y speedtest
|
$pkg_manager install -y speedtest
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
speedtest
|
speedtest
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue