diff options
| author | mhsanaei <ho3ein.sanaei@gmail.com> | 2025-07-06 12:22:36 +0300 |
|---|---|---|
| committer | mhsanaei <ho3ein.sanaei@gmail.com> | 2025-07-06 21:45:58 +0300 |
| commit | bbdeb65291ff6b2f4e55fb2056928e2a23621bd7 (patch) | |
| tree | 6af9403e887d078601ba6fa9b294b201445feb9e /install.sh | |
| parent | 038cf34219ed6f7ad2fcdc6497d527de031989d1 (diff) | |
new alternative to get public IP address
Diffstat (limited to 'install.sh')
| -rw-r--r-- | install.sh | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -85,7 +85,10 @@ config_after_install() { local existing_hasDefaultCredential=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'hasDefaultCredential: .+' | awk '{print $2}') local existing_webBasePath=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'webBasePath: .+' | awk '{print $2}') local existing_port=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'port: .+' | awk '{print $2}') - local server_ip=$(curl -s https://api.ipify.org) + local server_ip=$(curl -s --max-time 3 https://api.ipify.org) + if [ -z "$server_ip" ]; then + server_ip=$(curl -s --max-time 3 https://4.ident.me) + fi if [[ ${#existing_webBasePath} -lt 4 ]]; then if [[ "$existing_hasDefaultCredential" == "true" ]]; then |
