mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-04-16 12:35:54 +00:00
Merge 4348140a78 into 38d87230d3
This commit is contained in:
commit
929ece376b
3 changed files with 17 additions and 14 deletions
21
install.sh
21
install.sh
|
|
@ -76,37 +76,38 @@ is_port_in_use() {
|
||||||
install_base() {
|
install_base() {
|
||||||
case "${release}" in
|
case "${release}" in
|
||||||
ubuntu | debian | armbian)
|
ubuntu | debian | armbian)
|
||||||
apt-get update && apt-get install -y -q cron curl tar tzdata socat ca-certificates
|
apt-get update && apt-get install -y -q cron curl tar tzdata socat ca-certificates openssl
|
||||||
;;
|
;;
|
||||||
fedora | amzn | virtuozzo | rhel | almalinux | rocky | ol)
|
fedora | amzn | virtuozzo | rhel | almalinux | rocky | ol)
|
||||||
dnf -y update && dnf install -y -q curl tar tzdata socat ca-certificates
|
dnf -y update && dnf install -y -q curl tar tzdata socat ca-certificates openssl
|
||||||
;;
|
;;
|
||||||
centos)
|
centos)
|
||||||
if [[ "${VERSION_ID}" =~ ^7 ]]; then
|
if [[ "${VERSION_ID}" =~ ^7 ]]; then
|
||||||
yum -y update && yum install -y curl tar tzdata socat ca-certificates
|
yum -y update && yum install -y curl tar tzdata socat ca-certificates openssl
|
||||||
else
|
else
|
||||||
dnf -y update && dnf install -y -q curl tar tzdata socat ca-certificates
|
dnf -y update && dnf install -y -q curl tar tzdata socat ca-certificates openssl
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
arch | manjaro | parch)
|
arch | manjaro | parch)
|
||||||
pacman -Syu && pacman -Syu --noconfirm curl tar tzdata socat ca-certificates
|
pacman -Syu && pacman -Syu --noconfirm curl tar tzdata socat ca-certificates openssl
|
||||||
;;
|
;;
|
||||||
opensuse-tumbleweed | opensuse-leap)
|
opensuse-tumbleweed | opensuse-leap)
|
||||||
zypper refresh && zypper -q install -y curl tar timezone socat ca-certificates
|
zypper refresh && zypper -q install -y curl tar timezone socat ca-certificates openssl
|
||||||
;;
|
;;
|
||||||
alpine)
|
alpine)
|
||||||
apk update && apk add curl tar tzdata socat ca-certificates
|
apk update && apk add curl tar tzdata socat ca-certificates openssl
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
apt-get update && apt-get install -y -q curl tar tzdata socat ca-certificates
|
apt-get update && apt-get install -y -q curl tar tzdata socat ca-certificates openssl
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
gen_random_string() {
|
gen_random_string() {
|
||||||
local length="$1"
|
local length="$1"
|
||||||
local random_string=$(LC_ALL=C tr -dc 'a-zA-Z0-9' </dev/urandom | fold -w "$length" | head -n 1)
|
openssl rand -base64 $(( length * 2 )) \
|
||||||
echo "$random_string"
|
| tr -dc 'a-zA-Z0-9' \
|
||||||
|
| head -c "$length"
|
||||||
}
|
}
|
||||||
|
|
||||||
install_acme() {
|
install_acme() {
|
||||||
|
|
|
||||||
|
|
@ -100,8 +100,9 @@ is_port_in_use() {
|
||||||
|
|
||||||
gen_random_string() {
|
gen_random_string() {
|
||||||
local length="$1"
|
local length="$1"
|
||||||
local random_string=$(LC_ALL=C tr -dc 'a-zA-Z0-9' </dev/urandom | fold -w "$length" | head -n 1)
|
openssl rand -base64 $(( length * 2 )) \
|
||||||
echo "$random_string"
|
| tr -dc 'a-zA-Z0-9' \
|
||||||
|
| head -c "$length"
|
||||||
}
|
}
|
||||||
|
|
||||||
install_base() {
|
install_base() {
|
||||||
|
|
|
||||||
5
x-ui.sh
5
x-ui.sh
|
|
@ -243,8 +243,9 @@ reset_user() {
|
||||||
|
|
||||||
gen_random_string() {
|
gen_random_string() {
|
||||||
local length="$1"
|
local length="$1"
|
||||||
local random_string=$(LC_ALL=C tr -dc 'a-zA-Z0-9' </dev/urandom | fold -w "$length" | head -n 1)
|
openssl rand -base64 $(( length * 2 )) \
|
||||||
echo "$random_string"
|
| tr -dc 'a-zA-Z0-9' \
|
||||||
|
| head -c "$length"
|
||||||
}
|
}
|
||||||
|
|
||||||
reset_webbasepath() {
|
reset_webbasepath() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue