From b9a8058dd54855623629b155604df9ea604f19d8 Mon Sep 17 00:00:00 2001 From: Peter Wood Date: Fri, 11 Apr 2025 13:25:30 +0000 Subject: [PATCH] fix: improve error handling for plexmediaserver.service checks and add Oh My Zsh upgrade script execution --- update.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/update.sh b/update.sh index 2e6e76c..94d6443 100755 --- a/update.sh +++ b/update.sh @@ -1,15 +1,22 @@ #!/bin/bash # checks if the plexmediaserver.service is defined on this machine. stop it if it is. -if systemctl is-active --quiet plexmediaserver.service; then +if systemctl is-active --quiet plexmediaserver.service 2>/dev/null; then sudo /home/acedanger/shell/plex.sh stop fi -omz update +omz_upgrade_script=~/.oh-my-zsh/tools/upgrade.sh + +# Check if the script exists and is executable +if [ -x "$omz_upgrade_script" ]; then + echo "Attempting Oh My Zsh upgrade..." + "$omz_upgrade_script" +fi + sudo nala update sudo nala upgrade -y # checks if the plexmediaserver.service is defined on this machine. start it if it is. -if systemctl is-enabled --quiet plexmediaserver.service; then +if systemctl is-enabled --quiet plexmediaserver.service 2>/dev/null; then sudo /home/acedanger/shell/plex.sh start fi