summaryrefslogtreecommitdiffstats
path: root/auth/sample/cass_data/scrub.sh
blob: 016b58a7d08cf539eaab937d5f7698ffdd11882a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
> user_role.dat
for ID in $(grep -v "#" ../data/sample.identities.dat | awk -F\| '{print $1}' | grep -v "^$"); do
  grep "$ID@" dats/user_role.dat >> user_role.dat
done

for D in ns ns_attrib perm role config; do 
  cp dats/$D.dat .
done

echo "Roles in TEST data not in sample.identities.dat (../data)"
UR="$(mktemp)"
DUR="$(mktemp)"

cat user_role.dat | awk -F\| '{print $1}' | sort -u > $UR
cat dats/user_role.dat | awk -F\| '{print $1}' | sort -u > $DUR

echo "Removed IDs from user_roles"
diff $UR $DUR | grep "^>" | sort -u 

rm "$UR" "$DUR"