-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from lostallmymoney/NoUser
No user
- Loading branch information
Showing
5 changed files
with
62 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,28 @@ | ||
#!/bin/sh | ||
# shellcheck disable=SC2046 | ||
# shellcheck disable=SC2009 | ||
|
||
if [ "$(id -u)" -ne 0 ];then | ||
if [ $# -eq 0 ]; then | ||
kill $(pgrep -f "naga start" -G "$USER") > /dev/null 2>&1 | ||
if [ "$(pgrep -f "naga start" -G 0 -c)" -ne 0 ]; then | ||
pkexec --user root kill $(pgrep -f "naga start" -G 0) | ||
kill $(pgrep -f "naga serviceHelper") > /dev/null 2>&1 | ||
if [ "$(pgrep -f "naga serviceHelper" -G 0 -c)" -ne 0 ]; then | ||
pkexec --user root kill $(pgrep -f "naga serviceHelper" -G 0) | ||
fi | ||
if [ "$(pgrep -f "naga service" -c)" -ne 0 ]; then | ||
pkexec --user root systemctl stop naga | ||
fi | ||
else | ||
kill $(pgrep -f "naga start" -G "$USER" | grep -v "$1") > /dev/null 2>&1 | ||
if [ "$(pgrep -f "naga start" -G 0 | grep -v "$1" -c)" -ne 0 ]; then | ||
pkexec --user root kill $(pgrep -f "naga start" -G 0 | grep -v "$1") | ||
fi | ||
if [ "$(pgrep -f "naga service" | grep -v "$1" -c)" -ne 0 ]; then | ||
pkexec --user root systemctl stop naga | ||
else | ||
kill $(pgrep -f "naga serviceHelper" | grep -v "$1") > /dev/null 2>&1 | ||
if [ "$(pgrep -f "naga serviceHelper" -G 0 | grep -v "$1" -c)" -ne 0 ]; then | ||
pkexec --user root kill $(pgrep -f "naga serviceHelper" -G 0 | grep -v "$1") | ||
fi | ||
fi | ||
else | ||
systemctl stop naga | ||
if [ $# -eq 0 ]; then | ||
kill $(ps aux | grep "naga start" | grep -v root | grep -v grep | awk '{print $2}') > /dev/null 2>&1 | ||
if [ "$(pgrep -f "naga start" -G 0 -c)" -ne 0 ]; then | ||
kill $(pgrep -f "naga start" -G 0) | ||
kill $(ps aux | grep "naga serviceHelper" | grep -v root | grep -v grep | awk '{print $2}') > /dev/null 2>&1 | ||
if [ "$(pgrep -f "naga serviceHelper" -G 0 -c)" -ne 0 ]; then | ||
kill $(pgrep -f "naga serviceHelper" -G 0) | ||
fi | ||
else | ||
kill $(ps aux | grep "naga start" | grep -v root | grep -v "$1" | grep -v grep | awk '{print $2}') > /dev/null 2>&1 | ||
if [ "$(pgrep -f "naga start" -G 0 | grep -v "$1" -c)" -ne 0 ]; then | ||
kill $(pgrep -f "naga start" -G 0 | grep -v "$1") | ||
kill $(ps aux | grep "naga serviceHelper" | grep -v root | grep -v "$1" | grep -v grep | awk '{print $2}') > /dev/null 2>&1 | ||
if [ "$(pgrep -f "naga serviceHelper" -G 0 | grep -v "$1" -c)" -ne 0 ]; then | ||
kill $(pgrep -f "naga serviceHelper" -G 0 | grep -v "$1") | ||
fi | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters