mirror of
https://github.com/ciderale/nixos-utm.git
synced 2024-12-14 11:37:37 +00:00
use pgrep for stopping utm
This commit is contained in:
parent
6e5fd49d57
commit
37583c7afa
1 changed files with 4 additions and 3 deletions
|
@ -77,12 +77,13 @@
|
|||
self'.packages.utm
|
||||
pkgs.coreutils
|
||||
pkgs.gnused
|
||||
pkgs.ps
|
||||
pkgs.procps
|
||||
];
|
||||
text = ''
|
||||
# shellcheck disable=SC2009
|
||||
if ps aux | grep '/[U]TM'; then
|
||||
UTM_PID=$(ps ax -o pid,command | grep '/[U]TM'| sed -ne 's/^[ ]*\([[:digit:]]*\) .*/\1/p')
|
||||
if pgrep '[U]TM'; then
|
||||
echo "exists"
|
||||
UTM_PID=$(pgrep '[U]TM')
|
||||
read -r -e -p "Running at $UTM_PID. Kill? (y/N)" -i "n" answer
|
||||
case "$answer" in
|
||||
y | Y | yes ) kill "$UTM_PID" ;;
|
||||
|
|
Loading…
Reference in a new issue