xref: /libbtbb/cmake/cleanup.sh (revision 054c205c290a4518b80df22fc3a3a1f2a8ca6269)
1#!/bin/bash
2
3# A quick and dirty script to remove old installs of
4# libbtbb, libubertooth and associated Ubertooth tools
5
6INSTALL_DIRS="/usr /usr/local"
7
8LIBS="btbb ubertooth"
9
10HEADERS="bluetooth_packet.h \
11         bluetooth_piconet.h \
12         bluetooth_le_packet.h \
13         ubertooth_interface.h \
14         ubertooth_control.h \
15         ubertooth.h \
16		 "
17
18if [ "$1" == "-d" ]
19then
20	EXEC="-print -exec rm -f {} ;"
21	echo "Deleting previous installs:"
22else
23	EXEC=-print
24	echo 'Installed files, use "sudo cleanup.sh -d" to delete these files'
25fi
26
27for dir in $INSTALL_DIRS; do
28	for lib in $LIBS; do
29		find ${dir}/lib -name "lib$lib.so*" $EXEC
30	done
31	for header in $HEADERS; do
32		find ${dir}/include -name "$header" $EXEC
33	done
34done
35