fix: 在 macOS 上跳过 Linux 专用配置

This commit is contained in:
Konano 2026-09-09 17:33:51 +08:00
parent 31b519f9ef
commit 1c3562b6a9

View File

@ -15,6 +15,7 @@ fi
# ============================================================ # ============================================================
configure_tuna() { configure_tuna() {
[ "$(uname)" = "Darwin" ] && return
[ $offline -eq 1 ] && return [ $offline -eq 1 ] && return
[ $abroad -eq 1 ] && return [ $abroad -eq 1 ] && return
@ -313,6 +314,7 @@ configure_mongodb() {
} }
configure_nginx() { configure_nginx() {
[ "$(uname)" = "Darwin" ] && return
[ $offline -eq 1 ] && return [ $offline -eq 1 ] && return
if [ ! -f /etc/apt/sources.list.d/nginx.sources ]; then if [ ! -f /etc/apt/sources.list.d/nginx.sources ]; then
curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor | sudo tee /usr/share/keyrings/nginx.gpg >/dev/null curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor | sudo tee /usr/share/keyrings/nginx.gpg >/dev/null
@ -432,6 +434,7 @@ configure_zsh_prefix() {
} }
configure_hostname() { configure_hostname() {
[ "$(uname)" = "Darwin" ] && return
if confirm_action "要修改 hostname 吗?" "N"; then if confirm_action "要修改 hostname 吗?" "N"; then
read -p "hostname: " new_hostname read -p "hostname: " new_hostname
echo $new_hostname | sudo tee /etc/hostname >/dev/null echo $new_hostname | sudo tee /etc/hostname >/dev/null
@ -487,6 +490,7 @@ configure_proxychains() {
} }
configure_node_exporter() { configure_node_exporter() {
[ "$(uname)" = "Darwin" ] && return
[ -f /usr/local/bin/node_exporter ] && return [ -f /usr/local/bin/node_exporter ] && return
[ $offline -eq 1 ] && return [ $offline -eq 1 ] && return
@ -596,6 +600,7 @@ configure_git_gpg() {
# ============================================================ # ============================================================
configure_swap() { configure_swap() {
[ "$(uname)" = "Darwin" ] && return
# Input the swap size # Input the swap size
read -p "Swap size (MB): " swap_size read -p "Swap size (MB): " swap_size
# Create a virtual memory file # Create a virtual memory file