-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathfilter.sys
48 lines (38 loc) · 1.45 KB
/
filter.sys
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
40
41
42
43
44
45
46
47
48
#!/bin/bash
# filter.sys
# KD4Z
# Version: 4.51
# script that executes system level search and replace operations to
# reduce the usersCSV octet count by abbreviating known values
# calls out to ~/filter.local if found in home directory
# where user can add their own operations
# receives filenameas first argument
#echo -e "${WHITE}Applying final filters${NC}"
# add back some sanity here
sed -i -e 's/Central Michigan Emergency Network Central Michigan Emergency Network/Central Michigan Emergency Net/g' $1
sed -i -e 's/SILENT KEY/SK/g' $1
sed -i -e 's/Communications/Comm/g' $1
sed -i -e 's/Amateur Radio Club/ARC/g' $1
sed -i -e 's:,cnty,:,,:g' $1
sed -i -e 's/Amateur Radio Amateur Radio Emergency Service/ARES/g' $1
sed -i -e 's/Amateur Radio Societ/ARS/g' $1
sed -i -e 's/Ccars Carteret County Amateur Radio Society In/CCARS/g' $1
sed -i -e 's/Ovec Ohio/Ohio/g' $1
sed -i -e 's/Group Brady/Group/g' $1
sed -i -e 's/<U+0080><U+0093>//g' $1
sed -i -e 's/<U+0093>//g' $1
# other states / provinces until supported in merge_users
sed -i -e 's/All Others//g' $1
sed -i -e 's/ALL OTHERS//g' $1
sed -i -e 's:OESTERREICH/AUSTRIA:AUSTRIA:g' $1
#sed -i -e 's/ / /g' $1
#sed -i -e 's/North /N. /g' $1
#sed -i -e 's/South /S. /g' $1
#sed -i -e 's/East /E. /g' $1
#sed -i -e 's/West /W. /g' $1
# local hook if desired for extra filtering
if [ -f ~/filter.local ]; then
echo -e "${WHITE}Applying local database filters${NC}"
chmod +x ~/filter.local
~/filter.local $1
fi