Václav Kubernát | d1beedc | 2020-09-07 12:09:05 +0200 | [diff] [blame] | 1 | set -eux |
| 2 | |
| 3 | if [[ $(dirname "$(dirname "$(realpath "$SYSREPO_REPOSITORY_PATH")")") != "@CMAKE_CURRENT_BINARY_DIR@" ]]; then |
| 4 | echo "\$SYSREPO_REPOSITORY_PATH is not inside the build dir! Aborting. ($SYSREPO_REPOSITORY_PATH)" |
| 5 | exit 1 |
| 6 | fi |
| 7 | |
| 8 | if [[ -z "$SYSREPO_SHM_PREFIX" ]]; then |
| 9 | echo '$SYSREPO_SHM_PREFIX is empty! Aborting.' |
| 10 | exit 1 |
| 11 | fi |
| 12 | |
| 13 | BACKEND="$1" |
| 14 | shift |
| 15 | if [[ "$BACKEND" = "netconf" ]]; then |
| 16 | # The `-f` argument is neccessary so that pkill matches the whole command |
| 17 | # line, including stuff set by `exec -a`. Otherwise it matches the name in |
| 18 | # /proc/{pid}/stat and that is usually limited to 15 characters, so |
| 19 | # netopeer2-server appears as netopeer2-serve |
| 20 | pkill -f "${SYSREPO_SHM_PREFIX}_netopeer2-server" |
| 21 | rm "$NETOPEER_SOCKET" |
| 22 | fi |
| 23 | |
| 24 | rm -r "$SYSREPO_REPOSITORY_PATH" |
| 25 | rm "/dev/shm/$SYSREPO_SHM_PREFIX"* |