Compare commits

...

3 commits

Author SHA1 Message Date
Mikhail Grigorev
f4c48cd3c0 Fixed self destroy 2025-09-28 16:48:37 +05:00
Mikhail Grigorev
79b8abe5fd Fixed typo 2025-09-28 16:40:58 +05:00
Mikhail Grigorev
10af8ee01a Fixed self destroy 2025-09-28 16:39:53 +05:00

View file

@ -14,6 +14,7 @@ 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() {
@ -63,7 +64,7 @@ arch() {
armv6* | armv6) echo 'armv6' ;; armv6* | armv6) echo 'armv6' ;;
armv5* | armv5) echo 'armv5' ;; armv5* | armv5) echo 'armv5' ;;
s390x) echo 's390x' ;; s390x) echo 's390x' ;;
*) rm -f ${cur_dir}/update.sh && _fail "Unsupported CPU architecture!" ;; *) echo -e "${red}Unsupported CPU architecture!${plain}" && rm -f "${cur_dir}/${script_name}" >/dev/null 2>&1 && exit 2;;
esac esac
} }
@ -128,7 +129,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 downloading x-ui, please be sure that your server can access GitHub" _fail "ERROR: Failed to download x-ui, please be sure that your server can access GitHub"
fi fi
fi fi
@ -191,7 +192,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 downloading x-ui.sh script, please be sure that your server can access GitHub" _fail "ERROR: Failed to download x-ui.sh script, please be sure that your server can access GitHub"
fi fi
fi fi
@ -212,7 +213,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 downloading startup unit x-ui.rc, please be sure that your server can access GitHub" _fail "ERROR: Failed to download 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