Only offer to restart lutris if it's running

This commit is contained in:
the-sane 2020-12-31 20:46:45 -05:00 committed by GitHub
parent a5d372a43b
commit 4cc8e3331c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -683,17 +683,13 @@ rm_vidcache() {
# Restart lutris # Restart lutris
lutris_restart() { lutris_restart() {
if [ "$lutris_needs_restart" = "true" ]; then if [ "$lutris_needs_restart" = "true" ] && [ "$(pgrep lutris)" ]; then
if message question "Lutris must be restarted to detect runner changes.\nWould you like this helper to restart it for you?"; then if message question "Lutris must be restarted to detect runner changes.\nWould you like this helper to restart it for you?"; then
if [ "$(pgrep lutris)" ]; then
debug_echo continue "Restarting Lutris..." debug_echo continue "Restarting Lutris..."
pkill -SIGTERM lutris && nohup lutris </dev/null &>/dev/null & pkill -SIGTERM lutris && nohup lutris </dev/null &>/dev/null &
else
message info "Lutris does not appear to be running."
fi fi
fi fi
lutris_needs_restart="false" lutris_needs_restart="false"
fi
} }
# Delete the selected runner # Delete the selected runner