Install/Un-install scripts for o-du/l2 repo
[it/dep.git] / o-du-high / bin / uinstall
diff --git a/o-du-high/bin/uinstall b/o-du-high/bin/uinstall
new file mode 100755 (executable)
index 0000000..2f151c5
--- /dev/null
@@ -0,0 +1,47 @@
+################################################################################
+#   Copyright (c) [2020] [Radisys]                                        #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+# This script is used to uininstall O-DU High
+#!/bin/bash
+
+if [[ $# -eq 0 ]] ; then
+    echo "ERROR : Missing input to the script"
+    echo "Required : ./uinstall <O-DU_High_Directory_Path_To_Delete_Code>"
+    exit 1
+fi
+
+CLONE_DIR=$1
+
+echo "***** Killing O-DU High binaries *****"
+pkill -9 odu
+pkill -9 cu_stub
+pkill -9 ric_stub
+
+echo "***** Remove O-DU High Directory *****"
+rm -r $CLONE_DIR
+
+echo "***** Bringing Down the Interfaces *****"
+INTERFACE=$(ip route | grep default | sed -e "s/^.*dev.//" -e "s/.proto.*//")
+INTERFACE="$(echo -e "${INTERFACE}" | tr -d '[:space:]')"
+ifconfig $INTERFACE:ODU down
+ifconfig $INTERFACE:CU_STUB down
+ifconfig $INTERFACE:RIC_STUB down
+
+echo ""
+echo "***** Uninstallation Complete *****"
+
+################################################################################
+#                              End of file                                     #
+################################################################################