update install_acme

This commit is contained in:
mhsanaei 2024-10-07 15:28:00 +02:00
parent e72f67ca54
commit 761eb5f384
No known key found for this signature in database
GPG key ID: 4DACC0663B5986F5

18
x-ui.sh
View file

@ -772,15 +772,23 @@ update_geo() {
}
install_acme() {
cd ~
LOGI "install acme..."
curl https://get.acme.sh | sh
# Check if acme.sh is already installed
if command -v ~/.acme.sh/acme.sh &>/dev/null; then
LOGI "acme.sh is already installed."
return 0
fi
LOGI "Installing acme.sh..."
cd ~ || return 1 # Ensure you can change to the home directory
curl -s https://get.acme.sh | sh
if [ $? -ne 0 ]; then
LOGE "install acme failed"
LOGE "Installation of acme.sh failed."
return 1
else
LOGI "install acme succeed"
LOGI "Installation of acme.sh succeeded."
fi
return 0
}