diff --git a/build/installer/MEGAcmd.sh b/build/installer/MEGAcmd.sh index 230bc0da..dc6e02fa 100755 --- a/build/installer/MEGAcmd.sh +++ b/build/installer/MEGAcmd.sh @@ -1,4 +1,4 @@ #!/bin/bash /Applications/MEGAcmd.app/Contents/MacOS/mega-cmd & -sleep 2 +sleep 1 osascript -e 'tell app "Terminal" to do script "/Applications/MEGAcmd.app/Contents/MacOS/MEGAcmdShell;exit" activate' diff --git a/build/megacmd/debian.compat b/build/megacmd/debian.compat index ec635144..301160a9 100644 --- a/build/megacmd/debian.compat +++ b/build/megacmd/debian.compat @@ -1 +1 @@ -9 +8 \ No newline at end of file diff --git a/build/megacmd/debian.prerm b/build/megacmd/debian.prerm index e1a8247b..769e8abf 100644 --- a/build/megacmd/debian.prerm +++ b/build/megacmd/debian.prerm @@ -1,3 +1,14 @@ #!/bin/bash -[ "$1" == "upgrade" ] && killall -s SIGUSR1 mega-cmd-server 2> /dev/null || true +# Check if the first argument is "upgrade" and if mega-cmd-server is running +if [ "$1" == "upgrade" ]; then + # Attempt to gracefully upgrade mega-cmd-server by sending SIGUSR1 + if pgrep mega-cmd-server >/dev/null; then + killall -s SIGUSR1 mega-cmd-server 2> /dev/null + echo "Sent SIGUSR1 to mega-cmd-server for upgrade." + else + echo "mega-cmd-server is not running." + fi +else + echo "Usage: $0 upgrade" +fi