Skip to content

Commit

Permalink
Reuse code of stop.sh in start.sh. Add Progress report and error hand…
Browse files Browse the repository at this point in the history
…ling if no arguments provided to start.sh
  • Loading branch information
sahandKashani authored and Robin Scheibler committed Feb 21, 2017
1 parent b2be2c0 commit d8affcf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
27 changes: 16 additions & 11 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
#!/bin/sh
export LD_LIBRARY_PATH=/usr/local/lib
#!/bin/bash

killall browser-main-daemon >> /dev/null 2>&1
killall browser-wsaudio >> /dev/null 2>&1
killall browser-wsconfig >> /dev/null 2>&1
if [ "${#}" -eq 0 ]; then
echo 'Error: ${1} must be the name of a log file.' 2>&1
exit 1
fi

nohup ./browser-main-daemon >> $1 2>&1 &
sleep 4
nohup ./browser-wsaudio >> $1 2>&1 &
nohup ./browser-wsconfig >> $1 2>&1 &
sleep 2
log_file="${1}"

echo "Daemons started!"
./stop.sh > /dev/null

echo -n 'Starting daemons '
nohup ./browser-main-daemon >> "${log_file}" 2>&1 &
sleep 4; echo -n '.'
nohup ./browser-wsaudio >> "${log_file}" 2>&1 &
sleep 1; echo -n '.'
nohup ./browser-wsconfig >> "${log_file}" 2>&1 &
sleep 1; echo -n '.'
echo " done"
6 changes: 3 additions & 3 deletions stop.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

killall browser-wsconfig
killall browser-wsaudio
killall browser-main-daemon
killall browser-main-daemon > /dev/null 2>&1
killall browser-wsaudio > /dev/null 2>&1
killall browser-wsconfig > /dev/null 2>&1

echo "Daemons stopped"

0 comments on commit d8affcf

Please sign in to comment.