Skip to content

Commit

Permalink
make the count invocation robust
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewwall committed Jul 4, 2024
1 parent 83a92aa commit 0cd2398
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ stop_old_weewxd() {
invoke-rc.d weewx-multi stop > /dev/null || true
fi
if [ "$1" = "systemd" ]; then
systemctl stop weewx > /dev/null 2>&1 || :
systemctl stop weewx > /dev/null || true
elif [ "$1" = "sysv" ]; then
invoke-rc.d weewx stop > /dev/null || true
fi
Expand Down Expand Up @@ -534,7 +534,7 @@ case "$1" in
num_weewxd=1
if [ "$2" != "" ]; then
# this is an upgrade so ensure that weewxd is not running
num_weewxd=count_instances
num_weewxd=$(count_instances)
stop_old_weewxd $pid1
fi
get_user_info
Expand Down
2 changes: 1 addition & 1 deletion pkg/weewx.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ echo "Using $WEEWX_USER:$WEEWX_GROUP as user:group"
num_weewxd=1
if [ $1 -gt 1 ]; then
# this is an upgrade, so ensure that weewx is not running
num_weewxd=count_instances
num_weewxd=$(count_instances)
stop_old_weewxd $pid1
fi
setup_defaults $pid1
Expand Down

0 comments on commit 0cd2398

Please sign in to comment.