Browse Source

fix: do not clear dns cache

pull/9162/merge
DarkPhoenix2704 3 months ago committed by Anbarasu
parent
commit
8d714ef3b4
  1. 16
      docker-compose/setup-script/noco.sh

16
docker-compose/setup-script/noco.sh

@ -261,19 +261,6 @@ install_package() {
fi fi
} }
reload_hosts() {
# Flush DNS cache on macOS
if [ "$(uname)" == "Darwin" ]; then
sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder
# Flush DNS cache on Linux (Debian/Ubuntu)
elif [ -f /etc/debian_version ]; then
sudo systemd-resolve --flush-caches >/dev/null 2>&1 || sudo service network-manager restart >/dev/null 2>&1
# Flush DNS cache on Linux (RHEL/CentOS)
elif [ -f /etc/redhat-release ]; then
sudo systemctl restart NetworkManager >/dev/null 2>&1
fi
}
add_to_hosts() { add_to_hosts() {
local IP="127.0.0.1" local IP="127.0.0.1"
local HOSTS_FILE="/etc/hosts" local HOSTS_FILE="/etc/hosts"
@ -289,8 +276,7 @@ add_to_hosts() {
echo "$IP ${CONFIG_MINIO_DOMAIN_NAME}" | sudo tee -a "$TEMP_HOSTS_FILE" > /dev/null echo "$IP ${CONFIG_MINIO_DOMAIN_NAME}" | sudo tee -a "$TEMP_HOSTS_FILE" > /dev/null
if sudo mv "$TEMP_HOSTS_FILE" "$HOSTS_FILE"; then if sudo mv "$TEMP_HOSTS_FILE" "$HOSTS_FILE"; then
print_info "Added ${CONFIG_MINIO_DOMAIN_NAME} to $HOSTS_FILE" print_info "Added ${CONFIG_MINIO_DOMAIN_NAME} to $HOSTS_FILE"
reload_hosts print_note "You may need to reboot your system, If the uploaded attachments are not accessible."
print_note "You may need to reboot your system"
else else
print_error "Failed to update $HOSTS_FILE. Please check your permissions." print_error "Failed to update $HOSTS_FILE. Please check your permissions."

Loading…
Cancel
Save