From b7f4414f5ab2a20973f9b5d3d7bbe0b8a9a8ddad Mon Sep 17 00:00:00 2001 From: Sneed Group Holder Date: Thu, 31 Oct 2024 11:09:29 -0500 Subject: [PATCH] Move autoreboot job to more-common-settings.sh --- full.zsh | 4 ---- lite.zsh | 4 ---- more-common-settings.sh | 23 +++++++++++++++++++++++ 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/full.zsh b/full.zsh index 3ac0644..15f0d69 100644 --- a/full.zsh +++ b/full.zsh @@ -113,10 +113,6 @@ echo "[DSMOSS] Install more networking tools..." brew install cloudflared miniupnpc brew install --cask cyberduck -# Add auto-reboot job cron job.... -echo "[DSMOSS] Add auto-reboot cron job..." -(sudo crontab -l 2>/dev/null; echo "0 0 * * 0 /sbin/shutdown -r now") | sort -u | sudo crontab - - # More common settings... echo "[DSMOSS] Run the more common settings script..." chmod +x "more-common-settings.sh" diff --git a/lite.zsh b/lite.zsh index e79bedc..4fa0e28 100755 --- a/lite.zsh +++ b/lite.zsh @@ -110,10 +110,6 @@ echo "[DSMOSS] Install more networking tools..." brew install cloudflared miniupnpc brew install --cask cyberduck -# Add auto-reboot job cron job.... -echo "[DSMOSS] Add auto-reboot cron job..." -(sudo crontab -l 2>/dev/null; echo "0 0 * * 0 /sbin/shutdown -r now") | sort -u | sudo crontab - - echo "[DSMOSS] Run the more common settings script..." chmod +x "more-common-settings.sh" ./more-common-settings.sh \ No newline at end of file diff --git a/more-common-settings.sh b/more-common-settings.sh index 854d9fa..559e421 100755 --- a/more-common-settings.sh +++ b/more-common-settings.sh @@ -70,3 +70,26 @@ echo "[DSMOSS] Configure file manager..." defaults write com.apple.finder ShowPathbar -bool true defaults write com.apple.finder ShowStatusBar -bool true killall Finder + + +# Autokill mediaanalysisd... +echo "[DSMOSS] Disable mediaanalysisd..." +crontab -l | grep "@reboot killall mediaanalysisd" > /dev/null 2>&1 +if [ $? -eq 0 ]; then + echo "Crontab entry already exists." +else + # Add the entry to the crontab + echo "@reboot killall mediaanalysisd" | crontab - + echo "Crontab entry added successfully." +fi + +# Add autoreboot... +echo "[DSMOSS] Add autoreboot..." +sudo crontab -l | grep "0 0 * * 0 /sbin/shutdown -r now" > /dev/null 2>&1 +if [ $? -eq 0 ]; then + echo "Crontab entry already exists." +else + # Add the entry to the crontab + echo "0 0 * * 0 /sbin/shutdown -r now" | sudo crontab - + echo "Crontab entry added successfully." +fi