mirror of
https://github.com/tw93/Mole.git
synced 2026-02-16 18:10:17 +00:00
Merge branch 'main' of github.com:tw93/Mole
This commit is contained in:
@@ -212,7 +212,6 @@ is_bundle_orphaned() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
# Extra check for specific system bundles not covered by patterns
|
||||
case "$bundle_id" in
|
||||
loginwindow | dock | systempreferences | finder | safari)
|
||||
|
||||
@@ -67,7 +67,6 @@ clean_orphaned_casks() {
|
||||
done < <(brew list --cask 2> /dev/null || true)
|
||||
fi
|
||||
|
||||
|
||||
# Remove orphaned casks if found and sudo session is still valid
|
||||
if [[ ${#orphaned_casks[@]} -gt 0 ]]; then
|
||||
# Check if sudo session is still valid (without prompting)
|
||||
|
||||
@@ -52,8 +52,6 @@ clean_deep_system() {
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Clean macOS Install Data (system upgrade leftovers)
|
||||
# Only remove if older than 30 days to ensure system stability
|
||||
if [[ -d "/macOS Install Data" ]]; then
|
||||
|
||||
@@ -760,7 +760,7 @@ find_app_receipt_files() {
|
||||
|
||||
# Hard blocks
|
||||
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
|
||||
|
||||
if [[ "$is_safe" == "true" && -e "$clean_path" ]]; then
|
||||
|
||||
@@ -127,7 +127,7 @@ log_system_info() {
|
||||
echo "Shell: ${SHELL:-unknown} (${TERM:-unknown})"
|
||||
|
||||
# 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"
|
||||
else
|
||||
echo "Sudo Access: Required"
|
||||
|
||||
@@ -16,8 +16,6 @@ opt_system_maintenance() {
|
||||
echo -e "${RED}${ICON_ERROR}${NC} Failed to clear DNS cache"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
echo -e "${BLUE}${ICON_ARROW}${NC} Checking Spotlight index..."
|
||||
local md_status
|
||||
md_status=$(mdutil -s / 2> /dev/null || echo "")
|
||||
@@ -31,7 +29,6 @@ opt_system_maintenance() {
|
||||
sudo pkill -f blued 2> /dev/null || true
|
||||
echo -e "${GREEN}${ICON_SUCCESS}${NC} Bluetooth controller refreshed"
|
||||
|
||||
|
||||
}
|
||||
|
||||
# Cache refresh: update Finder/Safari caches
|
||||
@@ -112,7 +109,6 @@ opt_radio_refresh() {
|
||||
echo -e "${BLUE}${ICON_ARROW}${NC} Refreshing Wi-Fi service..."
|
||||
# Only restart Wi-Fi service, do NOT delete saved networks
|
||||
|
||||
|
||||
# Safe alternative: just restart the Wi-Fi interface
|
||||
local wifi_interface
|
||||
wifi_interface=$(networksetup -listallhardwareports | awk '/Wi-Fi/{getline; print $2}' | head -1)
|
||||
|
||||
Reference in New Issue
Block a user