Compare commits

..

No commits in common. "f4c48cd3c04f20ff34fdeb2c79a07ac7b27bdad0" and "1d76a90ae5df920e7588481e1c2eb31bcc780b87" have entirely different histories.

View file

@ -14,7 +14,6 @@ while [ -h "$b_source" ]; do
[[ $b_source != /* ]] && b_source="$b_dir/$b_source" [[ $b_source != /* ]] && b_source="$b_dir/$b_source"
done done
cur_dir="$(cd -P "$(dirname "$b_source")" && pwd)" cur_dir="$(cd -P "$(dirname "$b_source")" && pwd)"
script_name=$(basename "$0")
# Check command exist function # Check command exist function
_command_exists() { _command_exists() {
@ -64,7 +63,7 @@ arch() {
armv6* | armv6) echo 'armv6' ;; armv6* | armv6) echo 'armv6' ;;
armv5* | armv5) echo 'armv5' ;; armv5* | armv5) echo 'armv5' ;;
s390x) echo 's390x' ;; s390x) echo 's390x' ;;
*) echo -e "${red}Unsupported CPU architecture!${plain}" && rm -f "${cur_dir}/${script_name}" >/dev/null 2>&1 && exit 2;; *) rm -f ${cur_dir}/update.sh && _fail "Unsupported CPU architecture!" ;;
esac esac
} }
@ -129,7 +128,7 @@ update_x-ui() {
echo -e "${yellow}Trying to fetch version with IPv4...${plain}" echo -e "${yellow}Trying to fetch version with IPv4...${plain}"
${wget_bin} --inet4-only -N -O /usr/local/x-ui-linux-$(arch).tar.gz https://github.com/MHSanaei/3x-ui/releases/download/${tag_version}/x-ui-linux-$(arch).tar.gz 2>/dev/null ${wget_bin} --inet4-only -N -O /usr/local/x-ui-linux-$(arch).tar.gz https://github.com/MHSanaei/3x-ui/releases/download/${tag_version}/x-ui-linux-$(arch).tar.gz 2>/dev/null
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
_fail "ERROR: Failed to download x-ui, please be sure that your server can access GitHub" _fail "ERROR: Failed to downloading x-ui, please be sure that your server can access GitHub"
fi fi
fi fi
@ -192,7 +191,7 @@ update_x-ui() {
echo -e "${yellow}Trying to fetch x-ui with IPv4...${plain}" echo -e "${yellow}Trying to fetch x-ui with IPv4...${plain}"
${wget_bin} --inet4-only -O /usr/bin/x-ui https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.sh >/dev/null 2>&1 ${wget_bin} --inet4-only -O /usr/bin/x-ui https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.sh >/dev/null 2>&1
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
_fail "ERROR: Failed to download x-ui.sh script, please be sure that your server can access GitHub" _fail "ERROR: Failed to downloading x-ui.sh script, please be sure that your server can access GitHub"
fi fi
fi fi
@ -213,7 +212,7 @@ update_x-ui() {
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
${wget_bin} --inet4-only -O /etc/init.d/x-ui https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.rc >/dev/null 2>&1 ${wget_bin} --inet4-only -O /etc/init.d/x-ui https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.rc >/dev/null 2>&1
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
_fail "ERROR: Failed to download startup unit x-ui.rc, please be sure that your server can access GitHub" _fail "ERROR: Failed to downloading startup unit x-ui.rc, please be sure that your server can access GitHub"
fi fi
fi fi
chmod +x /etc/init.d/x-ui >/dev/null 2>&1 chmod +x /etc/init.d/x-ui >/dev/null 2>&1