correctly kill ssb-server

This commit is contained in:
poka 2020-06-04 16:19:22 +02:00
parent 3dbc6ee5b4
commit 5015ba21e4
1 changed files with 8 additions and 2 deletions

View File

@ -111,8 +111,14 @@ if [[ ! $(which oasis) ]]; then
npm -g install ssb-server ## ADD SSB-SERVER FOR PRIVATE SSB MESSAGING (TODO: integrate Feedless modules on LOVELand Portal)
else
echo "Stopping OASIS"
kill -9 $(ps auxf --sort=+utime | grep -w oasis | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}')
kill -9 $(ps auxf --sort=+utime | grep -w ssb-server | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}')
tokill=$(ps auxf --sort=+utime | grep -w oasis | grep -v -E 'color=auto|grep' | awk '{print $2}')
tokill+=$(ps auxf --sort=+utime | grep -w ssb-server | grep -v -E 'color=auto|grep' | awk '{print $2}')
for tokill in $ssbD; do
kill -9 $tokill
done
fi