blob: a3472714f034d9ed7bc35d632369855df52d4e86 [file] [log] [blame]
Alex Stancu29ce3682019-11-02 10:38:59 +02001#!/bin/bash
2
3sleep 5
4
5set -eu -o pipefail
6
7shopt -s failglob
8
9: ${SYSREPOCTL:=sysrepoctl}
10: ${SYSREPOCFG:=sysrepocfg}
11: ${SYSREPOCTL_ROOT_PERMS:=-o root:root -p 600}
12: ${YANG_DIR:=@CMAKE_CURRENT_SOURCE_DIR@/yang}
13: ${STARTUP_DIR:=@CMAKE_CURRENT_SOURCE_DIR@/yang/startup}
14
15is_yang_module_installed() {
16 module=$1
17
18 $SYSREPOCTL -l | grep --count "^$module [^|]*|[^|]*| Installed .*$" > /dev/null
19}
20
21uninstall_yang_module() {
22 module=$1
23
24 if ! is_yang_module_installed $module; then
25 echo "- Module $module not installed, skipping..."
26 else
27 $SYSREPOCTL -u -m $$module
28 fi
29}
30
31echo "- Uninstalling code-model and microwave-model..."
32uninstall_yang_module microwave-model,core-model