Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the issue regarding start check #154

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions linux/scripts/start_seattle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,16 @@ sleep 1
# 'ax': shows all processes
# 'ww': makes sure that the output is not limited by column length.
#

NMMAIN=`ps axww 2>/dev/null | grep nmmain.py | grep -v grep`
SOFTWAREUPDATER=`ps axww 2>/dev/null | grep softwareupdater.py | grep -v grep`

# However, OpenWrt has a Busybox implementation of 'ps' which does not provide
# the used parameters. Therefore we use 'ps ww' on OpenWrt instead.
if [ "$(uname -m)" == "mips" ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to think more about OS detection. #95 sketches the problem for ARM-based platforms.

then
NMMAIN=`ps ww 2>/dev/null | grep nmmain.py | grep -v grep`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also just (re)define a variable, say PS_COMMAND, in the if/else construct, so that it is ps ww on one platform and ps awwx on others. Later do $PS_COMMAND so as to use the rest of the command string unchanged.

SOFTWAREUPDATER=`ps ww 2>/dev/null | grep softwareupdater.py | grep -v grep`
else
NMMAIN=`ps axww 2>/dev/null | grep nmmain.py | grep -v grep`
SOFTWAREUPDATER=`ps axww 2>/dev/null | grep softwareupdater.py | grep -v grep`
fi

if echo "$NMMAIN" | grep nmmain.py > /dev/null
then
Expand Down