blob: 7c7106e2556e8750ee22b415278c3c52a08e35d5 [file] [log] [blame]
Brian O'Connor8a0c20e2015-09-16 22:54:24 -07001#!/bin/bash
2
3# Check if onos is running; if it is, stop onos
4[ -z "$(status onos 2>/dev/null | grep start)" ] && echo "onos is not running." || (
5 stop onos
6
7 # Wait for onos to stop up to 5 seconds
8 for i in $(seq 1 5); do
9 [ -z "$(ps -ef | grep karaf.jar | grep -v grep)" ] && break
10 sleep 1
11 done
12 [ -z "$(ps -ef | grep karaf.jar | grep -v grep)" ] && echo 'Stopped onos service' || echo 'Failed to stop onos'
Brian O'Connor8a0c20e2015-09-16 22:54:24 -070013)
14
15# Clean up onos runtime directories
16# TODO don't hardcode karaf version
Ray Milkey5f5db1f2020-01-31 16:25:57 -080017rm -rf /opt/onos/apache-karaf-4.2.8/
Brian O'Connor8a0c20e2015-09-16 22:54:24 -070018rm -rf /opt/onos/var/*
19rm -rf /opt/onos/config
20rm -rf /opt/onos/options
21rm -rf /opt/onos/log
22
23#TODO consider removing the sdn user if we created it