1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-15 18:40:05 +00:00

Merge branch 'main' of github.com:tw93/Mole

This commit is contained in:
Tw93
2025-12-12 14:36:00 +08:00
9 changed files with 38 additions and 46 deletions

View File

@@ -212,7 +212,6 @@ is_bundle_orphaned() {
return 1 return 1
fi fi
# Extra check for specific system bundles not covered by patterns # Extra check for specific system bundles not covered by patterns
case "$bundle_id" in case "$bundle_id" in
loginwindow | dock | systempreferences | finder | safari) loginwindow | dock | systempreferences | finder | safari)

View File

@@ -67,7 +67,6 @@ clean_orphaned_casks() {
done < <(brew list --cask 2> /dev/null || true) done < <(brew list --cask 2> /dev/null || true)
fi fi
# Remove orphaned casks if found and sudo session is still valid # Remove orphaned casks if found and sudo session is still valid
if [[ ${#orphaned_casks[@]} -gt 0 ]]; then if [[ ${#orphaned_casks[@]} -gt 0 ]]; then
# Check if sudo session is still valid (without prompting) # Check if sudo session is still valid (without prompting)

View File

@@ -52,8 +52,6 @@ clean_deep_system() {
fi fi
fi fi
# Clean macOS Install Data (system upgrade leftovers) # Clean macOS Install Data (system upgrade leftovers)
# Only remove if older than 30 days to ensure system stability # Only remove if older than 30 days to ensure system stability
if [[ -d "/macOS Install Data" ]]; then if [[ -d "/macOS Install Data" ]]; then

View File

@@ -760,7 +760,7 @@ find_app_receipt_files() {
# Hard blocks # Hard blocks
case "$clean_path" in case "$clean_path" in
/System/*|/usr/bin/*|/usr/lib/*|/bin/*|/sbin/*) is_safe=false ;; /System/* | /usr/bin/* | /usr/lib/* | /bin/* | /sbin/*) is_safe=false ;;
esac esac
if [[ "$is_safe" == "true" && -e "$clean_path" ]]; then if [[ "$is_safe" == "true" && -e "$clean_path" ]]; then

View File

@@ -127,7 +127,7 @@ log_system_info() {
echo "Shell: ${SHELL:-unknown} (${TERM:-unknown})" echo "Shell: ${SHELL:-unknown} (${TERM:-unknown})"
# Check sudo status non-interactively # Check sudo status non-interactively
if sudo -n true 2>/dev/null; then if sudo -n true 2> /dev/null; then
echo "Sudo Access: Active" echo "Sudo Access: Active"
else else
echo "Sudo Access: Required" echo "Sudo Access: Required"

View File

@@ -16,8 +16,6 @@ opt_system_maintenance() {
echo -e "${RED}${ICON_ERROR}${NC} Failed to clear DNS cache" echo -e "${RED}${ICON_ERROR}${NC} Failed to clear DNS cache"
fi fi
echo -e "${BLUE}${ICON_ARROW}${NC} Checking Spotlight index..." echo -e "${BLUE}${ICON_ARROW}${NC} Checking Spotlight index..."
local md_status local md_status
md_status=$(mdutil -s / 2> /dev/null || echo "") md_status=$(mdutil -s / 2> /dev/null || echo "")
@@ -31,7 +29,6 @@ opt_system_maintenance() {
sudo pkill -f blued 2> /dev/null || true sudo pkill -f blued 2> /dev/null || true
echo -e "${GREEN}${ICON_SUCCESS}${NC} Bluetooth controller refreshed" echo -e "${GREEN}${ICON_SUCCESS}${NC} Bluetooth controller refreshed"
} }
# Cache refresh: update Finder/Safari caches # Cache refresh: update Finder/Safari caches
@@ -112,7 +109,6 @@ opt_radio_refresh() {
echo -e "${BLUE}${ICON_ARROW}${NC} Refreshing Wi-Fi service..." echo -e "${BLUE}${ICON_ARROW}${NC} Refreshing Wi-Fi service..."
# Only restart Wi-Fi service, do NOT delete saved networks # Only restart Wi-Fi service, do NOT delete saved networks
# Safe alternative: just restart the Wi-Fi interface # Safe alternative: just restart the Wi-Fi interface
local wifi_interface local wifi_interface
wifi_interface=$(networksetup -listallhardwareports | awk '/Wi-Fi/{getline; print $2}' | head -1) wifi_interface=$(networksetup -listallhardwareports | awk '/Wi-Fi/{getline; print $2}' | head -1)