| # Change this accordingly |
| script_name="topology_rest.py" |
| restscript=${WEBDIR}/$script_name |
| LOGDIR=${ONOSDIR}/onos-logs |
| REST_LOG="${LOGDIR}/rest.`hostname`.log" |
| for i in `seq $(expr $nr_max - 1) -1 1`; do |
| if [ -f ${logfile}.${i} ]; then |
| mv -f ${logfile}.${i} ${logfile}.`expr $i + 1` |
| pids=`ps -edalf |grep ${script_name} | grep python | grep -v grep | awk '{print $4}'` |
| echo "Killed existing prosess (pid: $p)" |
| nr_process=`ps -edalf |grep ${script_name} | grep python | grep -v grep | wc -l` |
| if [ x${nr_process} != "x" ] ; then |
| echo "rest server is running" |
| echo "rest server is not running" |
| $restscript > $REST_LOG 2>&1 & |
| echo "Usage: $0 {start|stop|restart|status}" |