mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-28 23:54:59 +00:00
fix: prevent kill apt process by accident (#1054)
This commit is contained in:
parent
792e61b24f
commit
71d0b69eee
2 changed files with 8 additions and 9 deletions
|
@ -12,10 +12,10 @@ set -e
|
||||||
case "$1" in
|
case "$1" in
|
||||||
install|upgrade)
|
install|upgrade)
|
||||||
# Check if SourceGit is running and stop it
|
# Check if SourceGit is running and stop it
|
||||||
if pidof -q sourcegit || pgrep -f sourcegit > /dev/null; then
|
if pgrep -f '/opt/sourcegit/sourcegit' > /dev/null; then
|
||||||
echo "SourceGit is running, stopping it..."
|
echo "Stopping running SourceGit instance..."
|
||||||
killall sourcegit 2>/dev/null || pkill -f sourcegit 2>/dev/null || true
|
pkill -f '/opt/sourcegit/sourcegit' || true
|
||||||
# Wait for SourceGit to exit
|
# Give the process a moment to terminate
|
||||||
sleep 1
|
sleep 1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -15,11 +15,10 @@ set -e
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
remove|upgrade|deconfigure)
|
remove|upgrade|deconfigure)
|
||||||
# Check if SourceGit is running and stop it
|
if pgrep -f '/opt/sourcegit/sourcegit' > /dev/null; then
|
||||||
if pidof -q sourcegit || pgrep -f sourcegit > /dev/null; then
|
echo "Stopping running SourceGit instance..."
|
||||||
echo "SourceGit is running, stopping it before removal..."
|
pkill -f '/opt/sourcegit/sourcegit' || true
|
||||||
killall sourcegit 2>/dev/null || pkill -f sourcegit 2>/dev/null || true
|
# Give the process a moment to terminate
|
||||||
# Wait for SourceGit to exit
|
|
||||||
sleep 1
|
sleep 1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue