diff options
| author | mhsanaei <ho3ein.sanaei@gmail.com> | 2024-10-07 16:28:00 +0300 |
|---|---|---|
| committer | mhsanaei <ho3ein.sanaei@gmail.com> | 2024-10-07 16:28:00 +0300 |
| commit | 761eb5f38435dee33ca6c6088321cb5005a43acb (patch) | |
| tree | 57b918f736d212ed3e4b85eb7f13451fcfe2b0ea | |
| parent | e72f67ca54dd8e4a2a5b263f466603a60d20a9d2 (diff) | |
update install_acme
| -rw-r--r-- | x-ui.sh | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -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 } |
