File: cleanup.sh

package info (click to toggle)
libbtbb 2018.12.R1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,852 kB
  • sloc: ansic: 20,088; python: 922; sh: 186; makefile: 128; ruby: 21
file content (39 lines) | stat: -rwxr-xr-x 885 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash

# A quick and dirty script to remove old installs of
# libbtbb, libubertooth and associated Ubertooth tools
# Copyright 2014 Dominic Spill
# License: GPL v2

FIND=`which find`

INSTALL_DIRS="/usr /usr/local"

LIBS="btbb ubertooth"

HEADERS="bluetooth_packet.h \
         bluetooth_piconet.h \
         bluetooth_le_packet.h \
         ubertooth_interface.h \
         ubertooth_control.h \
         ubertooth.h \
		 "

if [ "$1" == "-d" ]
then
	EXEC="-print -exec rm -f {} ;"
	echo "Deleting previous installs:"
else
	EXEC=-print
	echo 'Installed files, use "sudo cleanup.sh -d" to delete these files'
fi

for dir in $INSTALL_DIRS; do
	for lib in $LIBS; do
		$FIND ${dir}/lib -maxdepth 1 -name "lib$lib.so*" $EXEC
	done
	for header in $HEADERS; do
		$FIND ${dir}/include -maxdepth 1 -name "$header" $EXEC
	done
	$FIND ${dir}/bin -maxdepth 1 -name "ubertooth-*" $EXEC
done