mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-04-18 05:25:49 +00:00
Compare commits
2 commits
a9ddc11888
...
b621dd94d0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b621dd94d0 | ||
|
|
91aad724c2 |
1 changed files with 10 additions and 41 deletions
51
x-ui.sh
51
x-ui.sh
|
|
@ -1673,29 +1673,15 @@ run_speedtest() {
|
|||
|
||||
run_librespeed() {
|
||||
|
||||
echo -e "${yellow}What do you want to do?\n1) Use\n2) Install/Update\n3) Delete"
|
||||
read -p ": " action
|
||||
|
||||
if [ "$action" = 1 ]; then
|
||||
if command -v librespeed-cli &>/dev/null; then
|
||||
librespeed-cli
|
||||
else
|
||||
echo -e "${red}LibreSpeed is not installed!"
|
||||
fi
|
||||
|
||||
elif [ "$action" = 2 ]; then
|
||||
echo -e "${yellow} Installing\Updating LibreSpeed..."
|
||||
#Uninstall old version, or actual version
|
||||
rm -f librespeed-cli_*_linux_amd64.tar.gz && rm -rf /usr/bin/librespeed-cli
|
||||
if command -v librespeed-cli &>/dev/null; then
|
||||
librespeed-cli
|
||||
else
|
||||
#Intalling LibreSpeed
|
||||
echo -e "${yellow} Installing LibreSpeed..."
|
||||
VERSION=$(curl -s "https://api.github.com/repos/librespeed/speedtest-cli/releases/latest"| grep '"tag_name":' | sed -E 's/.*"v?([^"]+)".*/\1/')
|
||||
wget https://github.com/librespeed/speedtest-cli/releases/download/v${VERSION}/librespeed-cli_${VERSION}_linux_amd64.tar.gz
|
||||
tar -xzvf librespeed-cli_${VERSION}_linux_amd64.tar.gz && mv librespeed-cli /usr/bin
|
||||
echo -e "${green}Starting libreSpeed... (Delete old archive)"
|
||||
librespeed-cli
|
||||
elif [ "$action" = 3 ]; then
|
||||
#Uninstall LibreSpeed
|
||||
rm -f librespeed-cli_*_linux_amd64.tar.gz && rm -rf /usr/bin/librespeed-cli
|
||||
echo -e "${green}LibreSpeed was deleted!"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
@ -1905,31 +1891,14 @@ EOF
|
|||
}
|
||||
|
||||
change_dns() {
|
||||
echo -e "${yellow}Changing DNS resolver"
|
||||
echo -e "${plain}Enter resolver (default: quad9): "
|
||||
echo -e "${yellow}${plain}Changing DNS resolver"
|
||||
echo -e "${plain}Enter resolver (default: 9.9.9.9): "
|
||||
read resolver
|
||||
|
||||
IPv6_on=$(cat /proc/sys/net/ipv6/conf/all/disable_ipv6)
|
||||
echo $IPv6_on
|
||||
|
||||
if [ "$IPv6_on" = 0 ]; then
|
||||
echo -e "${green}Your server using IPv6!"
|
||||
echo -e "${plain}Enter server for IPv6"
|
||||
read -p ": " resolver_ipv6
|
||||
if [ -n "$resolver" ] && [ -n "$resolver_ipv6" ]; then
|
||||
echo "nameserver $resolver" > /etc/resolv.conf
|
||||
echo "nameserver $resolver_ipv6" > /etc/resolv.conf
|
||||
else
|
||||
echo "nameserver 9.9.9.9" > /etc/resolv.conf
|
||||
echo "nameserver 2620:fe::fe" > /etc/resolv.conf
|
||||
fi
|
||||
if [ -n "$resolver" ]; then
|
||||
echo "nameserver $resolver" > /etc/resolv.conf
|
||||
else
|
||||
echo -e "${green}IPv6 is disabled!"
|
||||
if [ -n "$resolver" ]; then
|
||||
echo "nameserver $resolver" > /etc/resolv.conf
|
||||
else
|
||||
echo "nameserver 9.9.9.9" > /etc/resolv.conf
|
||||
fi
|
||||
echo "nameserver 9.9.9.9" > /etc/resolv.conf
|
||||
fi
|
||||
echo -e "${green}${plain}Done!"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue